PDA

View Full Version : Help please/moving buttons/images



aprilpgb22
18 Jun 2008, 12:23 PM
I am a newbie and I ask that someone please help me. I am currently using Dreamweaver 8, and I am trying to get my image/buttons to move up or down when the mouse touches over it, and when the mouse leaves I would like for it to go back to its original position on the page. Does anyone know the java script code for this? Are there tutorials on how to do it?

mick.dodd
18 Jun 2008, 04:55 PM
you could use flash to do this and as a newbie its a lot more frendly than jumping straight into javascript however


<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaScript>
intImage = 2;
function swapImage() {
switch (intImage) {
case 1:
IMG1.src = "http://www.microsoft.com/library/toolbar/images/mslogo.gif"
intImage = 2
return(false);
case 2:
IMG1.src = "http://msdn.microsoft.com/msdn-online/start/images/msdn-logo.gif"
intImage = 1
return(false);
}
}
</SCRIPT>
</HEAD>
<BODY>
<IMG id="IMG1" name="IMG1" src="http://www.microsoft.com/library/toolbar/images/mslogo.gif"
onclick="swapImage();">
</BODY>
</HTML>

this basic code should do it and if you make the buttons look like they are gogn doen when the moses hovers this should work quite well