Lay Theme + scrollreveal js
-
Hello everyone,
I would like to use scrollreveal (https://scrollrevealjs.org) with lay theme, but I have some problems.
Scrollreveal works perfectly with the div (class=".box") that I integrate on the website via the "custom css and html" part, but it does not work at all on the div created in the lay theme grid.Do you know where the problem may come from?
The plugin may be simply incompatible with lay theme.Have a good day,
Samuel
-
Hi Samuel!
Did you have a look at the documentation about hot to embed Javascript code in Laytheme?
http://laytheme.com/documentation.html#custom-javascriptBecause your Lay Theme website is a "Single Page" JavaScript application you cannot just use
jQuery(document).ready(…)
to execute your js because the ready event only fires once when the website loads the first time.But you should use this instead:
window.laytheme.on("newpage", function(layoutObj, type, obj){ });
window.laytheme.on("newpageshown", function(layoutObj, type, obj){ });
Also I think, if you want to call ALL the div boxes on the page you should not use
sr.reveal('.box',500);
but
sr.reveal('div',500);
Does this solution work for you?
All the best!
Marius
-
Hello Marius,
Sorry for this very late response. The site was still not finished.Your solution works very well for me.
You can see the result at this address if you want:
http://chloenegre.com -
No worries Samuel! I am happy it works!
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it