java script loading
-
Hello ,
I have placed loading bar on my site when some one opens the website.
To load the java & elements first i have placed the code in /virtue/templates/head.php<script type="text/javascript" src="/wp-content/themes/virtue/testjava.js"></script> <div id="overlay"> <div id="progstat"></div> <div id="progress"></div> </div> <style type="text/css"> *{margin:0;} body{ font: 200 16px/1 sans-serif; } #overlay{ position:fixed; z-index:99999; top:0; left:0; bottom:0; right:0; background: #fff; transition: 1s 0.4s; } #progress{ height:4px; background:#444444; position:absolute; width:0; /* will be increased by JS */ top:50%; } #progstat{ font-size:1em; letter-spacing: 2px; font-weight: bold; position:absolute; top:50%; margin-top:-40px; width:100%; text-align:center; color:#000; } </style>
as it is in head.php so it is loading on every page.
I just want to load on front page.
The thing is i dont want to place div element in front-page.php as it loads after the header loads (loading bar gets delay)
Is there any way to load the div element first and only on front page.
Thank You
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘java script loading’ is closed to new replies.