Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. Add my own jquery code

Add my own jquery code

Scheduled Pinned Locked Moved Bug Reports
7 Posts 2 Posters 680 Views
  • 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.
  • NicolasN Offline
    NicolasN Offline
    Nicolas
    wrote on last edited by
    #1

    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
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      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
      0
      • NicolasN Offline
        NicolasN Offline
        Nicolas
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          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

          NicolasN 1 Reply Last reply
          0
          • mariusjopenM mariusjopen

            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

            NicolasN Offline
            NicolasN Offline
            Nicolas
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • NicolasN Offline
              NicolasN Offline
              Nicolas
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • mariusjopenM Offline
                mariusjopenM Offline
                mariusjopen
                Global Moderator
                wrote on last edited by
                #7

                Voila! :-)

                www.mariusjopen.world

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                šŸ’æ Email me here: šŸ’æ
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. 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:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                arminunruhA
                arminunruh
                F
                francesco
                L
                lurchifon
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search