Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
485 stars 114 forks source link

dragend("right")/dragend("left") problem #74

Open landwire opened 9 years ago

landwire commented 9 years ago

I am using this code below, but it only works to go from slide 1 to 2 on click. It also shows some odd behaviour, as it always goes to page 1 when you click any < and to page 2 when you click any >

Any ideas what might be wrong? Swiping works fine. The click event fires, as the console logs the event. Anyway, I appreciate any suggestions...

<button class="dragend-arrow dragend-left" value="Previous" onclick="prevdragpage('.dragend-navigation-blocks')"><</button>
<button class="dragend-arrow dragend-right" value="Next" onclick="nextdragpage('.dragend-navigation-blocks')">></button>

// dragend next/previous
      function prevdragpage(target) {
        console.log('previous');
        jQuery('div' + target).dragend("right");
      }

      function nextdragpage(target) {
          console.log('next');
          jQuery('div' + target).dragend("left");
      }

jQuery(document).ready(function($){
      // Dragend targeting
        $('.dragend-navigation-blocks').dragend({

      });
mkhenrik commented 8 years ago

I had a similar problem. It seems like the newest dragend.js file in the respository is not the same as the one that is used in the examples. I don´t know what have changed exactly but copying the dragend.js file that is referenced in the examples made it work for me.

ghost commented 7 years ago

I just commented line 876. Not sure if that messes up something else, but it works for me. if ( instance ) { //instance.updateInstance( settings ); } else {