• Hi guys. Just recently, I ran across this amazing piece of work: https://codepen.io/yesimaaron/pen/CFpeL

    I tried to save the page for offline studying. However, when I reopen the offline html file, the menu button doesn’t work.

    Specifically, everything load like normal, but I can keep clicking the menu button on the top right corner till kingdom come and nothing will happen. If the menu is already open when I save it, it will stay open. If it’s not, nothing can get it to load.

    I tried to copy the code to my site, and the same thing happened. No matter how many time I click the button, nothing will come down.

    Can anyone explain this, please?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    How are you enqueuing the JS files?

    Thread Starter vkhu

    (@vkhu)

    I just put all the JS in a <script> tag inside the header.php. Is that wrong? I’m quite new to this whole coding thing.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Sort of wrong.

    Better question: how are you loading jQuery?

    Is this a custom theme you are using, pre-made, where did you get it from?

    Sorry, for so many questions but the more information you give the better we can understand what is happening. ??

    Thread Starter vkhu

    (@vkhu)

    I create a function.php file and add the following code:

    add_action( 'wp_enqueue_script', 'load_jquery' );
    function load_jquery() {
        wp_enqueue_script( 'jquery' );
    }

    As for the theme, I’m creating a child theme of the theme customizr.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code does not work when save offline or applied to other site’ is closed to new replies.