New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wow items aren't animated/shown in DOM elements hidden at pageload #175
Comments
I implemented a workaround for this, a small behaviour hack which doesn't modify wow.js itself. We first need access to the wow instance from js, so load wow in this way: <script>
var wow = new WOW();
wow.init();
</script> Then, in the JS responsible for revealing hidden elements, the slideDown() closure looks like this: element.slideDown(300, function() {
if (typeof wow !== 'undefined') {
wow.scrolled = true;
wow.scrollCallback();
}
}); Not ideal but certainly workable. It'd be nice to see handling of this kind of situation baked in to wow, since at the moment the behaviour doesn't even fall back gracefully: eg. when a div is unhidden with |
This isn't that bad, but |
What browser are you using? WOW.js tries to detect DOM mutations, if you're revealing content by mutating the DOM (and how else could you), WOW should detect it. Perhaps this is a bug, could you please point to a page where this is not working? (Or put together a quick example maybe.) |
I tried wow.sync() before my workaround above but that didn't fix the problem.
Chrome and Firefox, latest. Not easy to show the page with the problem at the moment as its on a local server, but when I have a little time I'll knock together a simple fiddle to demo. It seems that wow is setting |
Oh, I see, that makes this a bug indeed. I'll look into that, thanks for reporting. |
More information I can't reproduce this problem in a simple case, as demonstrated by this codepen. Everything works just as expected. So I've put the page I'm working on up for you guys to look at: http://tmp.qgates.com/wowbug.html Load up the page, scroll down so that the "Detailed Information" button is somewhere near the page center or higher, and click it. First time around, the thumbnails get revealed OK. Refresh the page and, without scrolling, hit the "Detailed information" button again. The gfx remain hidden until you scroll manually. I've disabled my JS "Detailed Info" button handler on there for clarity as it doesn't affect the problem. If you want to see it with my JS, which essentially adds in some jQuery slidedown sugar, together with an intelligent scrolling algo, there's another version which swaps out lines 127 and 128 of the html. It doesn't really affect the problem; I left it out to show that its not some knock on from my JS. I'm confused by why it works first time in. I thought it was my scrolling algo forcing a scroll event to wow, but when I tried it without my scroller (ie. just unhiding the div), I saw the same behaviour: first time it works, subsequent times no. Apologies in advance if I've missed something stupid ;) |
I have the same sort of problem. I have a page of boxes that appear with wow. Each box is a trigger to a modal. Everything works great. But if I were to scroll down the page, then refresh the page...wow animates only the viewport boxes. This is to be expected since the other boxes are not in the viewport and thus won't be animated into visibility by wow. If I click on any box after page refresh, they trigger modals that appear with blank content. I have to scroll up to bring all the boxes into visibility before I can get the modals to appear with content. |
Any update on this bug? :) |
I have the same problem too. I guess there is a limit on elements. Better solution suggested on other issue. https://scrollrevealjs.org/ |
+1 I am also facing the same issue. When switching views in ui-router, after scrolling down in the view, the page loads with div hidden ( Here is the HTML i am using:
fixed with this - using this to initialize wow -
Thanks! |
thanks guys, work perfectly :) . |
You just need to do "new WOW().init();" every time, when you show the hidden content. |
I had similar issue and I solved that removing from CSS file 🥇 |
Hi All, FINALLY!! .wow { |
A simple workaround is on browser refresh scroll to top:
|
+1 I've the problem with Ember Routing. Some time ago it helped to call |
Hi please help me with Wow.js plugin. |
I have a situation where my page has hidden content in the DOM (display:none) which is then revealed with user actions on buttons and links using jQuery functions like slideDown().
The problem is wow doesn't detect this and won't animate/show items until the scrollbar is moved, despite the fact that they are already visible as blank placeholders on the screen. Any chance this could be fixed?
The text was updated successfully, but these errors were encountered: