FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need Help: Javascript stoped until all pages loaded.





phicha
I am just programming a site,
and i put a javascript menu where i get from www.dhtmlgoodies.com

but it become a problem, that menu cannot be used until all the whole pages loading finished. but my site contain many image, so a user need to wait until all picture to access this menu.

is there a way, to repair this thing ? i don't want my user just keep wait until all picture loaded just for click a menu...

Thanks, Smile
aningbo
its time u post the codes
phicha
no code, just open this sites www.bitsmikro.com,
the menu wont work until all pages loaded -__-"

thanks Smile
aningbo
i dont know. your webpage got loaded in a matter of seconds!! i got a fast connection and so can't really see the problem but anyways i'll check on your code after christmas. a little busy here
jabapyth
what is your menu js code?
phicha
aningbo wrote:
i dont know. your webpage got loaded in a matter of seconds!! i got a fast connection and so can't really see the problem but anyways i'll check on your code after christmas. a little busy here


merry christmas then~ Smile
oh if u got a fast connection then, while loading page just press Escape button on your keyboard.
The Left Menu wont work anymore and cannot be click, until u refreshed whole page and wait until finished.

thanks,
phicha
aningbo wrote:
i dont know. your webpage got loaded in a matter of seconds!! i got a fast connection and so can't really see the problem but anyways i'll check on your code after christmas. a little busy here


merry christmas then~ Smile
oh if u got a fast connection then, while loading page just press Escape button on your keyboard.
The Left Menu wont work anymore and cannot be click, until u refreshed whole page and wait until finished.

thanks,
IceCreamTruck
I'm saying this without having looked at anything more than your home page (I didn't view source, but the page loaded lightning fast for me too).

are the image tags on the page before the bulk of the menu system javascript coce? If so this might cause the browser to load images instead of javascript. Try placing javascript before image tags, or use CSS to auto-cashe the images so that old images don't load every time the page is called and/or mouse over effects.

Nice looking site, but honestly...I wish I could have given it more time, but the menu system loaded very fast for me and I'm on the slowest computer I have, so I can't go much further helping you with your experiment. Hope you find a solution.

BTW, have you considdered not using a javascript menu system. If slow loading is a problem, then please considder the vast amount of users that will not be able to see the links or use them. There is a push right now to make the internet more portable and more and more users will be using cell phones and PDAs to access the web. Your basic website needs to realize that, however pretty it may be. ;-p seriously it looks nice.
LukeakaDanish
Instead of giving you the rubbish answers everybody else has been giving you, i'm gonna try to help you solve the problem (so read on)

Somewhere towards the bottom of your first javascript section, this line appears:
Code:

window.onload = initMenu;

If I'm not much mistaken this means that the menu gets "initialized" once the window has finished loading.

Remove that line - we want it to happen as soon as the code for the menu has loaded, not when the entire page has loaded.

So...after this line:

Code:
<td width="193" height="11" background="images/bottom_left.gif" style="background-repeat:no-repeat; "></td>


...or somewhere around there, insert the following line:

Code:
<script type="text/javascript">initMenu();</script>


- this may stop it from working, or may mean it works perfectly - please tell me of the results...
LukeakaDanish
IceCreamTruck wrote:
I'm saying this without having looked at anything more than your home page (I didn't view source, but the page loaded lightning fast for me too).

are the image tags on the page before the bulk of the menu system javascript coce? If so this might cause the browser to load images instead of javascript. Try placing javascript before image tags, or use CSS to auto-cashe the images so that old images don't load every time the page is called and/or mouse over effects.

Nice looking site, but honestly...I wish I could have given it more time, but the menu system loaded very fast for me and I'm on the slowest computer I have, so I can't go much further helping you with your experiment. Hope you find a solution.

BTW, have you considdered not using a javascript menu system. If slow loading is a problem, then please considder the vast amount of users that will not be able to see the links or use them. There is a push right now to make the internet more portable and more and more users will be using cell phones and PDAs to access the web. Your basic website needs to realize that, however pretty it may be. ;-p seriously it looks nice.


I think you misunderstood something.

The menu works fine without javascript - it just doesn't animate/look as good.

Also 95% of all users have javascript - so it really isn't any concern at all! - the only thing wrong with doing javascript ONLY menus (the ones that don't work when you turn of javascript), is that search engines cant click them.

Also this "push" you describe is somewhat false, when one considers that it was started by the mobile phone companies paying w3c to add this attention - my usual strategy is: screw the people with screens smaller that 800*600 - their such a small user group, and they would benefit greatly from a new pc anyway Twisted Evil

One thing you could improve to improve the load speed: put the javascript in a separate file...that way the user only has to load it once.
Related topics
my site pages are unavailable!! and cant get to cpanel!
Best Designed Websites?
Balmer vows to kill Google
Networking scanner help & directions.
MySQL 5.0
Snow fall on website
If you have dialup in the US check this out for 5 frih$
Where to find Java Scripts
SEO techniques
I need a fool-proof anti-source view javascript.
can we run asp pages
Off-Screen Objects Javascript
Problems with internet explorer 8
Table Help / Javascript dopdown menu
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.