This is a migrated thread and some comments may be shown as answers.

event handling

1 Answer 98 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Kirill
Top achievements
Rank 1
Kirill asked on 01 Oct 2011, 01:10 PM
HI again.
I have some element above the slider, so clicking or tapping on it doesn't cause slider working. How can I transmit click on my element to slider? I need do transmit X-coordinate. Relative X-coordinate will be the same because slider and element wich is luing above are children of the same parent. Anyway I can set some offset - I just need to know how can I transmit event and click x-coordinate. Has kendo some built-in methods?

1 Answer, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 03 Oct 2011, 09:18 AM
Hi Kirill,

Thank you for contacting us.

Unfortunately there are no build-in methods.

You can try this workaround:

$("#yourElement").click(function(e) {
    var slider = $("#slider").data("kendoSlider"),
        dragableArea = slider._getDragableArea(),
        location = kendo.touchLocation(e),
        mousePosition = slider._isHorizontal ? location.x : location.y,
        valueFromPosition = slider._getValueFromPosition(mousePosition, dragableArea);
 
    slider.value(valueFromPosition);
});

If this workaround is not working for you could you please provide more information about your scenario, thus I will be able to help you.

Kind regards,
Hristo Germanov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Slider
Asked by
Kirill
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or