change other Div attributes

liunx

Guest
hey all.

is it possible to change the attributes of another div? i want to have my links in one div, and then under hover, i want to change the color, or background picture of another div. is that possible? or should i be looking to javascript for this?

thxYou can give the illusion that's what you're doing with CSS, see this page (<!-- m --><a class="postlink" href="http://www.meyerweb.com/eric/css/edge/popups/demo.html">http://www.meyerweb.com/eric/css/edge/popups/demo.html</a><!-- m -->) for more details.learned somethin new from that. but i would like the image to show in a different div. how would i go about doing that?, im stumped...Well then you would probably need JavaScript, do you actually want to change an image in an <img /> tag or is it a background? Assuming it's an <img /> tag you'd go about it like this:<script type="text/javascript"><![CDATA[

function changeImg(newSrc){
document.getElementById("handle").src=http://www.webdeveloper.com/forum/archive/index.php/newSrc;
}

//]]></script>

<a href=http://www.webdeveloper.com/forum/archive/index.php/"somepage.html" onmouseover="changeImg('newsource.jpg');" onmouseout="changeImg('oldsource.jpg');">Hover over me.</a>

<img src=http://www.webdeveloper.com/forum/archive/index.php/"oldsource.jpg" alt="Here is some meaningful alternate text." id="handle" />The script uses the id on the image to reference it and change it's source.thx man, im gonna think about it. i could do different things, but i think i might go with the javascript. thanksWell you should only use JavaScript for non-essential things (ie: should only be used to add attractive fluff to a page), if the image is not essential to the page content then sure, by all means use JavaScript, however if it is essential then I would strongly urge you to find another way.

If you need ideas for accessible solutions then just fill me in on the details and I'm sure I can some up with a way to do it.

Happy to help. :)no worries, its not essential. i might not even use it, im kinda making the site as i go along.:)Originally posted by Booooze
i might not even use itSo glad I could help. :rolleyes:

:)lol, well, i orginally was going to use it, thats why i asked, but now i might have somethign else there instead:P
 
Back
Top