Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouseover to load an html page

Status
Not open for further replies.

Snive

Programmer
Jun 10, 2003
5
CA
I'm trying to create a menu using three different HTML files linked to eachother and I would like to use a mouseover script to get them to load without having to click on them. Is this possible? I would also like to put a delay on the mouseover so that you have to hover for two seconds before it will work.

Any help would be much appreciated.
Thanks
 
Are we in a frameset here?

If I'm on the wrong track completely, sing out - but you can load a page as a consequence of the link's onMouseOver event. You can use JavaScript to write a function to set a timeout of 2000ms (2 seconds) before opening the page. You could then tie another function to the link's onMouseOut event which would cancel the timeout set by the mouseover. This way the user would be able to move the mouse away from the link within 2 seconds of hovering over it, without the new page loading. Just yell if you need any further info on the technical side.

A side note though - It's probably not the best practise to take the control of the site out of the hands of the user. From a personal standpoint, I prefer to control when a new page loads by clicking on the link.
 
It is a frameset, the URL:

I believe I have solved the problem, but please check it out and let me know if this is the best way to do this. It's only on two links on the side navigation bar (Varsity Men and Varsity Women)

Please feel free to criticize, any help is greatly appreciated. This is the largest project I have ever been assigned and it is becoming increasingly difficult to get the proper scripting.

Thanks,
Snive
 
Aha, I was thinking that the links were to open a new page in the main frame.

The way you've gone about it certainly does the trick. However, should the time come when circumstances dictate that you ditch the frameset, you'll run into problems.

If you're after a challenge take a look at any of the many DHTML menu scripts out there which provide a facility to achieve the effect you've got, but without the overhead of reloading a new page every time (why let your poor web server do the work when the user's machine can do some of the processing).

Anyway, nice job.
 
dwarfthrower is right on regarding using DHTML menus. Check out
The menus are easy to implement and free. Your sub-menu solution is creative though. I wouldn't bother with the delay - just pop the sub-menu when the user mouse-over's. Looks great as is.





Mike Krausnick
Dublin, California
 
Thanks for your encouragement guys. I'm actually going to be using a whole lot of DHTML and Javascript throughout the website so I thought I'd let the user's machine rest a wee bit ;)

I've gone through the various scripts but never really decided on one that I really liked so I went with this one.

Hopefully it serves it's purpose.

I like the idea of no delay though, I might try it out.

Thanks again, your help is very much appreciated.

Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top