Jquery cycle plugin swipe
09.08.2015
Потребовалось сделать прокрутку пальцем на ipad / android для Views Slideshow (Jquery Cycle Plugin). Во второй версии этого плагина она имеется, а вот для первой скачал Touchwipe plugin и добавил
(function ($) {
$(document).ready(function () {
$('#views_slideshow_cycle_teaser_section_slider-block').touchwipe({
wipeLeft: function() {
$("#views_slideshow_cycle_teaser_section_slider-block").cycle("next");
},
wipeRight: function() {
$("#views_slideshow_cycle_teaser_section_slider-block").cycle("prev");
}
});
});
})(jQuery);
оригинальный пример
// First add your cycle code as normal
jQuery('#my_slider').cycle({
fx: 'scrollHorz',
speed: 1000,
next: '#next',
prev: '#prev',
});
// And then add this
jQuery("#my_slider").touchwipe({
wipeLeft: function() {
jQuery("#my_slider").cycle("next");
},
wipeRight: function() {
jQuery("#my_slider").cycle("prev");
}
});
#JQuery
