Jump to content

Javascript Rollover inside PHP


Davo

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.