scroll - jQuery & animate.css for scrollReveal -
i have been trying create reveal on scroll effect, have tried multiple plugins can't seem find of them fit i'm looking , if im not sure on how implement want do.
i have got piece of javascript code have been playing around with;
$(document).ready(function(){ $(window).scroll(function(){ $('.hideme').each(function(i){ var bottom_of_object = $(this).offset().top + $(this).outerheight(); var bottom_of_window = $(window).scrolltop(); + $(window).height(); if(bottom_of_window > bottom_of_object){ $(this).addclass('animated fadeinup', 1000); } }); }); });
the problem animation added once it's off screen have scroll past animation take effect work. i'm not sure on how make js implement animate.css code element in view of window/browser.
also thing have been trying remove class jquery (removeclass) method, hides , show's items without animating.
i have used gif illustrate problem (sorry being small).
there jsfiddle further illustrate problem; https://jsfiddle.net/1hwpswow/
anĂmate css works opacity, set opacity 0 , animation should work! also, must remove , add class of animate css every time use it!
Comments
Post a Comment