#4412 closed bug (duplicate)
Slider is initialized with animate and event-functions but they got lost by using methods
Reported by: | leeperry | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.slider | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The Slider is initialized by following code:
var min = 2000; var max = 2009; $("#slider").slider({ animate: true, min: min, max: max, change: function(event, ui) { $("#timeline_years li[class*='year']").removeClass("active"); $("#timeline_years li.year"+ui.value).addClass("active"); }, slide: function(event, ui) { $("#timeline_years li[class*='year']").removeClass("active"); $("#timeline_years li.year"+ui.value).addClass("active"); }, stop: function(event, ui) { changeInfo(ui.value); } });
this works all fine inside the slider area. BUT when I want to control the slider outside the slider area like:
$("#outsideSlider").click(function(){ $("#slider").slider('value',min); });
The indicator will move directly to the choosen value, but without any initialized option, that means no animation and no event function.
A reinitialization of the Slider or the redeclaration of all options with following code doesn't work either:
$("#outsideSlider").click(function(){ $("#slider").slider('option',{ animate: true, min: min, max: max, value: min, change: function(event, ui) { $("#timeline_years li[class*='year']").removeClass("active"); $("#timeline_years li.year"+ui.value).addClass("active"); }, slide: function(event, ui) { $("#timeline_years li[class*='year']").removeClass("active"); $("#timeline_years li.year"+ui.value).addClass("active"); }, stop: function(event, ui) { changeInfo(ui.value); } }); });
It will move, but also without animation and without any event-function.
Change History (3)
comment:1 Changed 14 years ago by
Milestone: | TBD → 1.7.2 |
---|
comment:2 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
See comment above for event handling, otherwise duplicate of #4432.
comment:3 Changed 14 years ago by
Milestone: | 1.7.2 → 1.8 |
---|
Note: See
TracTickets for help on using
tickets.
Not triggering events when programatically changing the value is intended behaviour (by design).
I'm not sure about the animation. It makes sense that it should be animated.