PDA

View Full Version : help me please



bulg
04 Mar 2009, 03:19 PM
ello, iam doing a school assignment and i for some reason i cant get it to work. Iam using radio buttons and once you click on a diferent radio button a different pic should pop up. here is the code can u please help me fix it? i have no idea where it went wrong.....


<!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" lang="en-IS"
xml:lang="en-US">

<head>
<title>Assignment 6 part 1</title>
<script type = " text/javascript">
<!--

var dom = "saw";
function toTop (newTop)
{
domTop = document.getElementById(top).style;
domNew = document.getElementById(newtop).style;
domTop.zIndex = "0";
domNew.zIndex = "10";
top = newTop;
}

//-->
</script>


<style type = "text/css">
.tool1 {position:absolute; top:30%; left:40%; z-index:0;}
.tool2 {position:absolute; top:30%; left:40%; z-index:0;}
.tool3 {position:absolute; top:30%; left:40%; z-index:0;}
</style>
</head>

<body>
<p><img class = "tool1" id = "saw" src="/tools/saw.jpg" alt="saw"
height="248" width="364" /></p>
<p><img class = "tool2" id = "pliers" src="/tools/pliers.jpg"
alt="pliers" height="248" width="364"/></p>

<p><img class = "tool3" id = "trimmer" src="/tools/tree_trimmer.jpg"
alt="trimmer" height="248" width="364" /></p>

<form id = "myForm" action ="">
<p>
<input type = "radio" name = "newTop" value ="1" onclick =
"toTop('tool1')"/> saw
<br />

<input type = "radio" name = "newTop" value ="2" onclick =
"toTop('tool2')"/> pliers
<br />

<input type = "radio" name = "newTop" value ="3" onclick =
"toTop('tool3')"/> trimmer
<br />
</p>
</form>


</body>
</html>



thanks!!!!!!