Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Add my own jquery code

    Bug Reports
    2
    7
    573
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Nicolas
      Nicolas last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Hi @Nicolas
        can you post a link to your website?

        Then I can have a look what does not work.

        Best!

        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • Nicolas
          Nicolas last edited by

          Hi @Marius
          Or course here is my website: [http://s480000440.onlinehome.fr/wp-test](link url)

          1 Reply Last reply Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

            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

            www.mariusjopen.world

            Nicolas 1 Reply Last reply Reply Quote 0
            • Nicolas
              Nicolas @mariusjopen last edited by

              Hi @mariusjopen
              I don't understand which username and password do you want in the email?

              1 Reply Last reply Reply Quote 0
              • Nicolas
                Nicolas last edited by

                it works !
                I had just forgotten to add a "}" in my code :)

                1 Reply Last reply Reply Quote 0
                • mariusjopen
                  mariusjopen Global Moderator last edited by

                  Voila! :-)

                  www.mariusjopen.world

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  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

                  Thanks!

                  Online Users

                  D
                  S

                  Recent Topics

                  • A

                    Unable to update lay theme / to login wp admin

                  • A

                    New button feature not available

                  • S

                    Theme crashed - because of Polylang?

                  • A

                    carousel addon not working after update

                  laytheme.com