问题
I have a simple event handler:
jssor_slider1.$On($JssorSlider$.$EVT_CLICK, function (slideIndex) {
jssor_slider1.$PlayTo(slideIndex - 4, [200]);
});
I have a problem trying to unbding it (i need to disable it in a different function, then enable it again on callback - when ajax loads). I tried $Off, also overwriting $On handler, but can't get it to work. Any help would be appreciated.
Cheers
回答1:
function SliderParkEventHandler(slideIndex) {
jssor_slider1.$PlayTo(slideIndex - 4, [200]);
}
jssor_slider1.$On($JssorSlider$.$EVT_CLICK, SliderParkEventHandler);
//use following code to unbind click event
//jssor_slider1.$Off($JssorSlider$.$EVT_CLICK, SliderParkEventHandler);
来源:https://stackoverflow.com/questions/26654256/jssor-unbinding-the-event