Click to See Complete Forum and Search --> : Image / mouse over question


newtda
10-19-2003, 03:41 PM
What i want to do is roll over the text and when the user does that i want a picture to load. If that that is poassible.

fredmv
10-19-2003, 06:08 PM
Something like this? ;)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>untitled</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<style type="text/css">
/*<![CDATA[*/
span {
font-family: helvetica, serif;
font-size: 10pt;
color: #009900;
font-weight: bold;
cursor: pointer;
}
/*]]>*/
</style>
<script type="text/javascript">
/*<![CDATA[*/
var img = null;
var out = null;

function loadImage(url)
{
out = document.getElementById( "test" );
out.innerHTML = '<img src="' + url + '" alt="" />';
}
/*]]>*/
</script>
</head>

<body>
<div>
<span onmouseover="loadImage( 'http://forums.webdeveloper.com/images/top_profile.gif' );">Image 1</span> |
<span onmouseover="loadImage( 'http://forums.webdeveloper.com/images/top_register.gif' );">Image 2</span>
<hr />
<div id="test"></div>
</div>
</body>
</html>

newtda
10-19-2003, 06:16 PM
yea something like that, where did you do that in?

fredmv
10-19-2003, 06:20 PM
Originally posted by newtda
where did you do that in? I coded it by hand. If you mean, "what language did I do it in", I used XHTML, CSS, and JavaScript. :cool: