Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Waypoint Plugin troubles
    primarykey
    data
    text
    <p>I'm having slight troubles with the jQuery Waypoint plugin, and any information/help is appreciated.</p> <p>Ok, so to define what I want to do: I have images, that are hidden prior to being in the view area. I want them to do an animation effect once in the view area. That is the final result, for now, I'm still in testing as I am generally new to jQuery but getting better.</p> <p>So I started out doing the shake on a single div, and it worked great once the once it was in view. I used the following code:</p> <p>HTML:</p> <pre><code>&lt;div class="shown"&gt;Shake it&lt;/div&gt; </code></pre> <p>jQuery</p> <pre><code>jQuery(document).ready(function($){ $(".shown").waypoint(function(direction) { $(this).effect("shake"); }, { offset: '95%', triggerOnce: true }); }); </code></pre> <p>Then I made two instances of the class='shown' in my HTML (one at top, and one at the bottom), and when I scrolled to them, they both worked great. Plus, they both worked at separate times, which is what I'm trying to gain.</p> <p><strong>Here's the trouble</strong></p> <p>When I tried to 'display:none' and then animate to show on scroll, it animates BOTH, instead of just the single at a time.</p> <p>This is what I'm using</p> <p>HTML</p> <pre><code>&lt;div class="shown" style="display: none;"&gt; </code></pre> <p>jQuery</p> <pre><code>jQuery(document).ready(function($){ $(".shown").waypoint(function(direction) { $(this).fadeIn( 10000, function() { // Animation complete }); }, { offset: '95%', triggerOnce: true }); }); </code></pre> <p>Ok, so just to clarify one more time :D (to be safe)</p> <p>I want to be able to use the same class for MULTIPLE instances, that will only display once THAT element is in view. Right now it's displaying ALL elements once 1 instance is in view.</p> <p>Again, any information/help is appreciated. You guys have a great community here, I'm glad I could join!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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