Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-04-2009, 04:29 PM Rollover Question
Super Talker

Posts: 132
Trades: 0
Hey guys.

So I've always had this question, just never got it answered or really attempted to figure it out.

I have global rollovers on my topnav, but I want the one for the certain page I'm on to stay in it's "over state".

I've usually just accomplished this by using event handlers in the html but I didn't want to do that this time around. I want to have all the script in the .js. I was trying to think of how to do it and the only way I really thought of was to give the body of the page an ID but then I'd have to do something (in laymans terms) like this, "if tagname body has the id of _____ then ignore ________ function or whatever. I'm sure this isn't the right way to do this.

Any help would be great, I'm pretty new to javascript.

Here's how I'm doing the rollovers at the moment:

Code:
home.onmouseover = function() {
        home.src = "images/home-over.jpg";
    }
    home.onmouseout = function() {
        home.src = "images/home.jpg";
    }
A friend of mine showed me a better way to do it using e.targ, etc. but I'm not too familiar with it so didn't use it.

Thanks!!!
soap is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-05-2009, 12:57 PM Re: Rollover Question
kcmartz's Avatar
Super Talker

Latest Blog Post:
~Gri to Kcmartz~
Posts: 120
Name: Kenson
Location: Washington, USA
Trades: 0
Check this javascript website out:
http://javascript.internet.com/

It has tons of javascript stuff!

No Problem!
__________________
Thanks,

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
for problems/site.
kcmartz is offline
Reply With Quote
View Public Profile Visit kcmartz's homepage!
 
Reply     « Reply to Rollover Question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09601 seconds with 12 queries