Davo Posted May 18, 2010 Share Posted May 18, 2010 Hello all I have been trying to get a javascript rollover to function on a button that is called into the page with PHP. (PHP echo) The button appears and links as attended but the rollover won't work. Probably best to give some background I am working on an instructional image for a client's website. The image shows an electronic product and two buttons. (on and off) The buttons "turn" the product on and off. This works great with the Javascript rollovers typed onto the page. However I need the buttons to 'change' according to another variable and so have used PHP to achieve this. Here is how I am putting the javascript into the PHP - is it something obvious that I have missed? $MobileImage= "<a href='Rollover2.php?id=On' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage('Image35','','Images/MobileRO.jpg',1)'><img name='Image35' border='0' src='Images/Mobile.jpg'></a>"; Thanks! Cheers Davo Quote Link to comment Share on other sites More sharing options...
.josh Posted May 18, 2010 Share Posted May 18, 2010 is MM_swapImage() and MM_swapImgRestore() php functions or javascript functions? edit: and are you actually echoing out $MobileImage somewhere? Quote Link to comment Share on other sites More sharing options...
Davo Posted May 18, 2010 Author Share Posted May 18, 2010 Hi Crayon MM_swapImage() and MM_swapImgRestore() are the javascript functions $MobileImage is the button that is being echoed. Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.