Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery syntax - hover not working on infinite scroll pages
    primarykey
    data
    text
    <p>I'm using the infinite-ajax-scroll plugin (<a href="https://github.com/webcreate/infinite-ajax-scroll" rel="nofollow">https://github.com/webcreate/infinite-ajax-scroll</a>) along with the Hover Caption plugin (<a href="http://ryun.github.io/HCaptions/" rel="nofollow">http://ryun.github.io/HCaptions/</a>). The hover effect works well on the first page, however it isn't applied to the pages loaded via the infinite scroll plugin. </p> <p>I have read that using .on() instead of .hover() should work and have also tried the .scroll() event. However, I can't seem to get anything working without amending the code within the plugins which isn't ideal. </p> <p>What event should I be detecting to activate the hcaption plugin and how do I write this?</p> <p>My code below:</p> <pre><code>&lt;script&gt; $(document).ready(function () { //hcaptions for mouseover tiles $('.hcaption').hcaptions({ effect: "slide", direction: "bottom" }); //isotope var $container = $('#container'), filters = {}; $container.isotope({ itemSelector: '.element, .element_tile', }); // Infinite Ajax Scroll configuration jQuery.ias({ container: '#main', // main container where data goes to append item: '.element', // single items pagination: '.paginate', // page navigation next: '.paginate a', // next page selector loader: '&lt;img src="public/img/ajax-loader.gif"/&gt;', // loading gif loaderDelay: 200, thresholdMargin: -600, noneleft: 'No more discounts', //Contains the message to be displayed when there are no more pages left to load triggerPageThreshold: '10', // show "load more" if scroll more than this to stop trigger: "", onLoadItems: function (newElements) { // hide new items while they are loading var $newElems = $(newElements).css({ opacity: 0 }); // ensure that images load before adding to isotope layout $newElems.imagesLoaded(function () { // show elems now they're ready $newElems.animate({ opacity: 1 }); $container.isotope('insert', $newElems, true); }); return true; } }); }); &lt;/script&gt; </code></pre> <p>Section of code from hcaption.js that possibly needs overwriting: </p> <pre><code> $target.css('z-index',opts.zindex+1).hide(); $wrap.hover(function () { $target.stop(true, true).fadeIn(+opts.speed, opts.onshow()); }, function () { $target.stop(true, true).fadeOut(+opts.speed, opts.onhide()); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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