/    Sign up×
Community /Pin to ProfileBookmark

I have groups of links, something like this:

<h1>Home</h1>
<a href=home1.html>Home1</a>
<a href=home2.html>Home2</a>
<a href=home3.html>Home3</a>
<h1>School</h1>
<a href=school1.html>School1</a>
<a href=school2.html>School2</a>
<a href=school3.html>School3</a>
etc.

Now I’d like if you mouseover Home1, 2 or 3, the <h1>Home</h1> will light up as though it’s a link. Same to School and other groups of links…

How can I do that? Thanx!

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 20.2005 — For example:
<i>
</i>&lt;h1 id="home"&gt;Home&lt;/h1&gt;
&lt;a href="home1.html"
onmouseover="document.getElementById('home').style.backgroundColor='yellow';return true;"
onmouseout="document.getElementById('home').style.backgroundColor='white';return true;"&gt;Home1&lt;/a&gt;
Copy linkTweet thisAlerts:
@The_Anime_KingauthorMar 21.2005 — So far, so good ?

Just some little adjustments:

I would like to change the fontcolor instead of the backgroundcolor.

Also, isn't there any shorter way to do this, cause it's a lot of code. something like this:
[code=php]<h1 id=home>Home</h1>
<a href=link1 onMouseOver=blink(home) onMouseOut=dull(home)>Link1</a>

<script>
function blink(id){
document.getElementById(id).style.fontColor='white';
return true;"
}

function dull(id){
document.getElementById(id).style.fontColor='silver';
return true;"
}
</script>[/code]


Thanks!
Copy linkTweet thisAlerts:
@the_treeMar 21.2005 — You could have a list with two items (Home and School) and nest lists in each item (the links) then you could use hover affects for the big list item in the same way that you would apply hover affects for the individual links.
Copy linkTweet thisAlerts:
@The_Anime_KingauthorMar 21.2005 — I'm not very good with programming in javascript, so I have really no idea what the code should be ?

Could someone pliz help me with that?

Thanx!
Copy linkTweet thisAlerts:
@phpnoviceMar 21.2005 — This:

<a href=link1 onMouseOver=blink(home) onMouseOut=dull(home)>Link1</a>

would be this:

<a href=link1

onMouseOver="return blink('home')"

onMouseOut="return dull('home')">Link1</a>

and this (in your functions):

return true;"

would be this:

return true;
×

Success!

Help @The_Anime_King 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.19,
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,
)...