#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    977
    Rep Power
    11

    Javascript stopping page loading


    Hi,

    When I add the following javascript, my page stops loading. I have tried adding it to various places in my page, but it doesn't seem to make a difference.


    PHP Code:
    <script type="text/javascript">
    jQuery(document).ready(function() 
    {
        $(
    '#parallax .parallax-layer')
        .
    parallax({
            
    mouseport: $('#parallax')
        });
    });
    </script> 
    Any ideas?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    9
    Rep Power
    0
    I'm not a jquery person, and I don't know what browser you are using, but you could try adding defer into your script tag.

    PHP Code:
    <script type="text/javascript" defer
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    977
    Rep Power
    11
    Thanks, but it didn't work
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    977
    Rep Power
    11
    I found the solutions was to add {literal} and {/literal} around the code as it was in a .tpl file.

IMN logo majestic logo threadwatch logo seochat tools logo