Note that there are some explanatory texts on larger screens.

plurals
  1. POTrigger animation when scrolling
    primarykey
    data
    text
    <p>Is there any chance of making these animations I've seen on this tutorial <a href="http://www.netmagazine.com/tutorials/getting-animations-trigger-right-time" rel="nofollow">http://www.netmagazine.com/tutorials/getting-animations-trigger-right-time</a> work for elements without an image (a row of text blocks for example)? Everything works fine but once I remove the image the effect stops working. Not sure if I made myself clear. Thank you! </p> <pre><code>&lt; script &gt; if (Modernizr.csstransitions) { function preloadImages(imgs, callback) { var cache = [], imgsTotal = imgs.length, imgsLoaded = 0; $(imgs).each(function (i, img) { var cacheImage = document.createElement('img'); cacheImage.onload = function () { if (++imgsLoaded == imgsTotal) callback(); }; cacheImage.src = $(img).attr('src'); cache.push(cacheImage); }); }; $.fn.trans = function () { var t = arguments[0], d = arguments[1] || ''; if (t) { $.each(this, function (i, e) { $(['-webkit-', '-moz-', '-o-', '-ms-', '']).each(function (i, p) { $(e).css(p + 'transition' + d, t); }); }); } }; document.write('&lt;link rel="stylesheet" href="animations.css" /&gt;'); $(function () { //preload images contained within elements that need to animate preloadImages($('.services img, .featured img'), function () { $('.services, .featured').appear({ once: true, forEachVisible: function (i, e) { $(e).data('delay', i); }, appear: function () { var delay = 150, stagger = 800, sequential_delay = stagger * parseInt($(this).data('delay')) || 0; $(this).children().each(function (i, e) { $(e).trans(i * delay + sequential_delay + 'ms', '-delay'); }); $(this).removeClass('animationBegin'); } }); }); }); } &lt; /script&gt; </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.
 

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