/    Sign up×
Community /Pin to ProfileBookmark

Simple Java Help

? I do not know Java… that’s next in my learning experience. But I think I need a simple script for what I want to do.

The homepage for [url]www.cnn.com[/url] just recently implemented a new homepage with a horizontal menu bar across the page; the background changes color “onmouseover”. I have wanted to do this for some time, but the conventional html options (including fprolloverstyle, etc) only changes the background behind the text, not the entire table cell where the text is located). Looking at the cnn code, I see they use a script (CNN_navHor) in each “td” tag to accomplish this affect. It must be a simple script, but again, I have not yet learned java.

Can someone help? Thanks! ?

Bill

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Apr 14.2006 — First I will help you realize that Java is not JavaScript.

NOw for your basic idea on how to do it:

[CODE]<td onmouseover="this.className='red';
onmouseout="this.className='white';" onclick="document.location.href='asdf.html'">
<a href="asdf.html">Test - ClickM</a></td>[/CODE]



Eric
Copy linkTweet thisAlerts:
@bathurst_guyApr 14.2006 — You should use CSS for this instead of JavaScript. This will ensure that it works on more browsers and will take less code.
Copy linkTweet thisAlerts:
@WmIrvinauthorApr 14.2006 — ?

Eric, thanks for the help, but I must be missing something. Nothing happened. I took out all other formatting I had, including fprolloverstyle, and I inserted a double-quote where one seems to be missing in your code. Here is the code I used:

<td width="135" height="20" align="center" valign="middle"

onmouseover="this.className='red';" onmouseout="this.className='blue';"

onclick="document.location.href='FFrame.asp?Pg=1c&MGN=VPC-18';">

<a href="FFrame.asp?Pg=1c&MGN=VPC-18" target="_top"

style="text-decoration: none">

<center>Mission Statement</center></a></td>

Am I missing something?

Bill
Copy linkTweet thisAlerts:
@balloonbuffoonApr 14.2006 — Do you have two classes named "red" and "blue"?

--Steve
×

Success!

Help @WmIrvin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...