Search code examples
javaloadperformancespry

Delaying Javascript because it makes my Spry Tabbed Panels Hang


is there anything I can do to delay the loading of this script

<script src="http://content.webcollage.net/p1084307575097/showcase?showcase=ciscodmr"></script>

Because it affects my Spry Tabbed Panels, there are four tabbed panels that appear below each other until the above content appears, and then only does it snap into place...

Can anyone help


Solution

  • 4 ways to dinamically load js files: http://ntt.cc/2008/02/10/4-ways-to-dynamically-load-external-javascriptwith-source.html

    You may do something like:

    <script language="text/javascript">
        setTimeout(function(){ document.write("<script src='http://content.webcollage.net/p1084307575097/showcase?showcase=ciscodmr'><\/script>");}, 1000);
    </script>
    

    This will delay the loading by 1s(1000ms)