Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sandaly KEITA on Sep 30, 2008 06:30
open dhtmlx forum
dhtmlxSlider Events suite (No 3935 )

Hi,

I use the event onSlideEnd instead of onChange because I want to know the value when the user leave the slider

slider1.attachEvent("onSlideEnd",function(newValue,sliderObj){ alert("New values is "+newValue); });

It's work very well!

But when I click on the slider there's nothing.

I added
slider1.attachEvent("onChange",function(newValue,sliderObj){ alert("New values is "+newValue); });

It's work when I click but when I use slide I have many alert().

What can I do?

Thanks in advance
Answer posted by Support on Oct 01, 2008 02:55
This is expected behavior. 
 onSlideEnd event occurs only when slider button was draged and released. 
 onChange event occurs each time when state of slider changed 

You can use next code to ignore onChange call during slide drag

slider.attachEvent("onChange",function(val){
      if (this._busy) return; //ignore calls during drag
      .. your code here ..
});
Answer posted by Sandaly on Sep 30, 2008 09:57
Thank you!

It's perfect!