Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable a next/previous button(link) temporarily when clicked in jQuery Cycle plugin (not necessarily a jquery cycle issue)
    primarykey
    data
    text
    <p>I need to prevent link from being clicked for let's say 2 seconds.</p> <p>Here is an example <a href="http://jsbin.com/orinib/4/edit" rel="nofollow noreferrer">http://jsbin.com/orinib/4/edit</a></p> <p>When you look at the rendered mode you see next and prev links. When you click next, it slides with a nice transition. However if you click multiple times there is no transition sort of, which is expected. But my question: is this how can I prevent clicking on the next link, for about 2 seconds (or what ever time it takes for transition to happen) so that no matter what transition will occur. This is what I tried to use, but did not work:</p> <pre><code>function(){ var thePreventer = false; $("#next").bind($(this),function(e){ if(!thePreventer){ thePreventer = true; setTimeout(function(){ thePreventer = false; }, 2000); }else{ e.preventDefault(); } }); </code></pre> <p>}</p> <p>Which I got from here <a href="https://stackoverflow.com/questions/5380722/disable-a-link-temporarily-when-clicked">&quot;Disable&quot; a link temporarily when clicked?</a> I think. I believe that i cannot achieve this effect with this code (although it works on other links). I believe this is due to the fact that cycle-plugin got a hold of that link, and I understand that I have to bind/tap-into this functionality of the plugin. Please note: that this code may not work I just used it to show that I tried it and it did not work, you can reuse it if you have to or give me your own stuff.</p> <p>Please help, if you can.</p> <p><strong>EDIT</strong>: As <strong>mrtsherman</strong> proposed this simple yet elegant <strong>ANSWER</strong>: <a href="http://jsfiddle.net/LCWLb" rel="nofollow noreferrer">http://jsfiddle.net/LCWLb</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload