MDanz Posted October 3, 2009 Share Posted October 3, 2009 i did this but it isn't working?? <SCRIPT LANGUAGE="JavaScript"> function roll_over(img_name, img_src) { document[img_name].src = img_src; } </script> <A HREF="http://www.u-stack.com/search.php" onmouseover="roll_over('but1', 'http://www.u-stack.com/template2.jpg')" onmouseout="roll_over('but2', 'http://www.u-stack.com/template.jpg')"> <IMG SRC="http://www.u-stack.com/template.jpg" WIDTH="101" HEIGHT="101" NAME="but3" BORDER="0"> </A> Link to comment https://forums.phpfreaks.com/topic/176406-rollover-button-help/ Share on other sites More sharing options...
KevinM1 Posted October 3, 2009 Share Posted October 3, 2009 1. What exactly are you trying to do? 2. What isn't working? 3. Why aren't you using CSS for image rollovers? Link to comment https://forums.phpfreaks.com/topic/176406-rollover-button-help/#findComment-929786 Share on other sites More sharing options...
MDanz Posted October 3, 2009 Author Share Posted October 3, 2009 i tried with css background rollover... the problem is the text overlapping the backgrounds keeps on moving... so javascript is my best option to keep the text not moving. its just a rollover image button.... when i put my cursor over it should change image but it remains the same... Link to comment https://forums.phpfreaks.com/topic/176406-rollover-button-help/#findComment-929790 Share on other sites More sharing options...
.josh Posted October 3, 2009 Share Posted October 3, 2009 document.getElementById('idhere').src = "path/to/image"; 'idhere' needs to be the ID used in the image tag (like <img id="idhere" src="..." .. />) Link to comment https://forums.phpfreaks.com/topic/176406-rollover-button-help/#findComment-929791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.