Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to select the element relative to the current slider so change.</p> <pre><code> $('.well').fadeOut(); $(".well").addClass( "disappear" ); $('.well').add('&lt;h2&gt;Erbjudandet använt&lt;/h2&gt;'); </code></pre> <p>to</p> <pre><code> $well = $(this).closest('.well'); //Select only the respective well element. $well.fadeOut(); $well.addClass( "disappear" ); $well.add('&lt;h2&gt;Erbjudandet använt&lt;/h2&gt;'); ..... $well.prev(".showup").delay(500).removeClass( "disappear" ); </code></pre> <p>Similarly you can change this in other events as applicable.</p> <pre><code>$(".slider").draggable({ axis: 'x', containment: 'parent', drag: function(event, ui) { if (ui.position.left &gt; 200) { var $well = $(this).closest('.well'); $well.fadeOut(500, function(){ $well.delay(1000).addClass( "disappear" ); $well.prev(".showup").delay(500).removeClass( "disappear" ); }); } else { // $("h2 span").css("opacity", 100 - (ui.position.left / 5)) } }, stop: function(event, ui) { if (ui.position.left &lt; 201) { $(this).animate({ left: 0 }) } } }); $('.slider')[0].addEventListener('touchmove', function(event) { event.preventDefault(); var el = event.target; var touch = event.touches[0]; curX = touch.pageX - this.offsetLeft - 40; if(curX &lt;= 0) return; if(curX &gt; 200){ var $well = $(this).closest('.well'); $well.fadeOut(); $well.addClass( "disappear" ); $well.add('&lt;h2&gt;Erbjudandet använt&lt;/h2&gt;'); } el.style.webkitTransform = 'translateX(' + curX + 'px)'; }, false); </code></pre> <p><strong><a href="http://jsfiddle.net/DDhD4/" rel="nofollow">Fiddle</a></strong></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