Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#slider').on('touchstart', '.tp-caption > a', function(){
- self.location = $(this).attr('href');
- });
- //Переменная, в которую записывается, было ли перемещение
- var scrl = false;
- //Если было совершено событие touchmove, меняем значение переменной на true
- $('#slider').on('touchmove', '.tp-caption > a', function(){
- scrl = true;
- });
- //Во время выполнения touchend проверяем было ли перемещение, если было - обнуляем
- //значение переменной, а если не было - переходим по ссылке
- $('#slider').on('touchend', '.tp-caption > a', function(){
- if (scrl != true){
- self.location = $(this).attr('href');
- }else{
- scrl = false;
- }
- });
Add Comment
Please, Sign In to add comment