Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery problem with quik flip plugin
    text
    copied!<p>I have a problem with jquery plugin called quikflip. Basically, the plugin flips an image with a flipping effect like turning cards. I'm using it to flip a list of images of cards i have 20 cards, it's working good, but i want to flip 3 cards only and stop show alert and go to the next url.</p> <p>I'm new in jquery and dont know how to make it, I tried to make counter but no success.</p> <p>here is what i tried :</p> <pre><code>function count() { var n = $('quickFlip').length; if(n &gt; 3){ Alert('only 3' ); } else { $('.quickFlip').quickFlip(); // } } $('.quickFlip').click(countChecked); </code></pre> <p>the function of the plugin is called like this :</p> <pre><code>$(function() { $('.quickflip').quickFlip(); }); </code></pre> <p>the code of the plugin is here <a href="http://jonraasch.com/blog/quickflip-2-jquery-plugin" rel="nofollow">http://jonraasch.com/blog/quickflip-2-jquery-plugin</a>.</p> <p>I just copied exactly the code and no alert has been shown. I have another script which send with ajax ids of the div every time is clicked the card i dont khnow if it is interfering with my code that send infos:</p> <pre><code> &lt;script&gt; $(document).ready(function(){ $(".element").click(function () { var cururl = document.location.href; var path = $(this).attr('title') ; var cardid = $(this).attr('id') ; $.get('ajaxprocess.php', {Path: path,url: cururl,cardid:cardid}, function(data){ $('#test').text(data);}); }); }); &lt;/script&gt; </code></pre> <p>and the elements are like is </p> <pre><code>&lt;div class="quickFlip"&gt; &lt;div class="element" id= "id" title ="title"&gt; &lt;a href="#" class="quickFlipCta"&gt; &lt;/a&gt; &lt;/div&gt; the code for fliping is now like &lt;script type="text/javascript"&gt; $(function() { $('.quickflip').quickFlip(); }); $(function() { var timesFlipped = 0; var threshold = 3; $('.quickflip').quickFlip().click(function() { if(timeFlipped++ &gt;= threshold) { alert("Redirecting"); // do more stuff }}); }); &lt;/script&gt; </code></pre> <p>what am i doing wrong ?</p>
 

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