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. javascript doesn't work on all sites

javascript doesn't work on all sites

Scheduled Pinned Locked Moved Bug Reports
7 Posts 2 Posters 142 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.
  • A Offline
    A Offline
    ananazfr
    wrote on last edited by
    #1

    Hi,

    Whenever I hover over a link I would like to exchange the background image via custom javascript. It works fine on the frontpage. Now I would like to do exactly the same on another static page, same look, same code, just different id-xxx selectors. When I navigate through the webpage, starting from the front page, the javascript code is getting executed on the front page, but not on the static page.
    However, if I open a preview of that static page directly from within wordpress, then the javascript code is getting executed.

    Any hints why is that?

    I tried both

    window.laytheme.on("newpageshown", function(layoutObj, type, obj){
    });
    window.laytheme.on("newpage", function(layoutObj, type, obj){
    });
    

    Many thanks!
    Anna

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

      Dear @ananazfr Can you post a link to our website?
      Then we can have a look and inspect that.

      did you try to call a simple alert("TEST");?

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ananazfr
        wrote on last edited by
        #3

        Hi Marius,

        The alert is also only getting called as soon as I open the preview directly from the static page in wordpress, but not when I navigate to it (as described in my previous post) . Would be very grateful if you could have a look at it, maybe I am missing something totally obvious. The website is not supposed to be online at this point, will send you the login details.

        Many thanks!
        Anna

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

          Dear @ananazfr
          I called the console 3 times and all 3 calls worked on your website. Have a look in the CUSTOM HTMl section on your website.

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ananazfr
            wrote on last edited by
            #5

            Yes, the Javascript is called. Then there must be something with jQuery, A console.log is called whenever I mouseenter/mouseleave over this link. It gets called the first time (see screenshot), but when I navigate to a different site and go back it doesn't get called anymore. The body class id is the same.... I am kind of biting my fingers :/
            screen.png

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ananazfr
              wrote on last edited by
              #6

              fyi: I replaced jQuery with javascript, works fine so far.

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

                Dear @ananazfr

                yes. That is always the good solution!
                :-D

                Best!

                Marius

                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
                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