Add my own jquery code
-
Hi, i have made a pen with jquery code : https://codepen.io/nicolastilly/pen/MEvZPL
and i want to use it in my site with Lay theme.I write this in the "Custom CSS & HTML" but it doesn't work:
<script>
window.laytheme.on("newpageshown", function(layoutObj, type, obj){
if(type == "page" && obj.id == 68){jQuery(window).scroll(function() { newNumber=$(window).scrollTop(); newNumber=newNumber*myRatio; jQuery('#carre').css('transform', "rotateZ("+newNumber+"deg)"); }); myRatio= getRatio(20, 337); function getRatio(max, max2) { return max/max2; }
});
</script>
I don't understand very well how can i use jquery code in Lay...
Thanks. -
Hi @Nicolas
can you post a link to your website?Then I can have a look what does not work.
Best!
Marius
-
Hi @Marius
Or course here is my website: [http://s480000440.onlinehome.fr/wp-test](link url) -
Hi @Nicolas
Best is if you write an email to marius@thepeople.world and include your username, password and a link to this conversation.
Marius
-
Hi @mariusjopen
I don't understand which username and password do you want in the email? -
it works !
I had just forgotten to add a "}" in my code :) -
Voila! :-)
Before you post
Use the Search Feature. Maybe there is already a solution to your issue.
1. Update Lay Theme and all Lay Theme Addons
2. Disable all Plugins
3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
4. Now see if your problem solved itself
5. Go here, see if your problem is listed here:
Troubleshooting
When you post:
1. Post a link to where the problem is
2. If the problem is difficult to explain, post screenshots / link to a video to explain it