0

I need to understand how can I stop an event propagation, in particular the "change" propagation of a slider. normally, in my application, change is called when

  • I move the slider directly on the bar;
  • I change the slider position with this command $("#idPlayerSlider").slider("value", nNewPosition); somewhere in my code.

this is the slider:

$("#idPlayerSlider").slider({
  orientation: "horizontal",
  range: "min",
  max: nPlayerTime,
  value: PLAYER_VIEW.TIMESTAMP_TOTAL,
  change: seekPlayerVideo
});

this is the operation I do to change the slider value:

$("#idPlayerSlider").slider("value", nNewPosition);

the question is: is there a way to stop change propagation when I set the new value of the slider? because I need the change callback is called when I move it on the real slider, but if I force a new value i would like this callback is not called anymore. so the need is to stop its propagation. how can I do? thank you in advance.

axel
  • 3,778
  • 4
  • 45
  • 72
  • http://api.jquery.com/event.stopPropagation/ ? – Gal Feb 18 '13 at 09:14
  • i know about this command, but how to set it in the context of my scenario? that's because before i call `$("#idPlayerSlider").slider("value", nNewPosition);` i don't have the `event` which propagation need to be stopped. i can't call it after, because i still don't have the `event` variable, and at that time the event is already happenned. i need to manage the event _change_ of the [slider object](http://jqueryui.com/slider/) – axel Feb 18 '13 at 10:45
  • can you show me an example? – axel Feb 18 '13 at 10:47
  • Try refering to this question: http://stackoverflow.com/questions/10255041/jquery-slider-change-event-how-do-i-determine-who-called-it – Gal Feb 18 '13 at 10:54
  • I'll have a look, thank you. – axel Feb 18 '13 at 11:40

0 Answers0