Jump to content

return 2 actions from onmouseover


Riparian

Recommended Posts

Sorry if this is the wrong place as it is 50/50 javascript and php

 

I am trying to mouseover an image and  swap the image but if the 2nd image is not the primary model then display the image and a message to that extent.

 

This is what I have tried (with many variations) but cant get it to work .

 

$pic_name = original image

$pic2name = swapped image

 

<a href=" my file..."     target="popup"   onclick="msgopen('my file ...'); return false;"   />
     

     <img src="<?=$pic_name?>"  name="<?=$counter?>"  onMouseOver=" document.<?=$counter?>.src='<?=$pic2name ?>'"; return escape('Image is of Parent Stock Only') ;            

 

      onMouseOut="document.<?=$counter?>.src='<?=$pic_name?>';">

 

 </a>

 

There are many images on the screen hence the name="<?=$counter?>"

 

Any help is greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/
Share on other sites

Instead of using    document.<?=$counter?>   in OnMouseOver/Out use   this

<a href=" my file..."     target="popup"   onclick="msgopen('my file ...'); return false;"   />
     <img src="<?=$pic_name?>"  name="<?=$counter?>"  onMouseOver="this.src='<?=$pic2name ?>'; return escape('Image is of Parent Stock Only';"
                                                      onMouseOut="this.src='<?=$pic_name?>';">
 </a>

Thank you for the reply.

 

Unfortunately this did not do the trick.

 

The result was that it showed the 2nd (rolled over) image only with no message being displayed. Have I missed something.

 

This is the actual code :

                            <a href="expand.php?model=<?=$row[model_number]?>&page=<?=$page?>&prime=<?=$row[prime]?>"
                                target="popup"
                                onclick="msgopen('expand.php?model=<?=$row[model_number]?>&page=<?=$page?>&prime=<?=$row[prime]?>', 'popup', 900, 600); return false;"
                               />
                                <img src="<?=$pic_name?>" name="<?=$row[model_number]?>" height="<?=$height?>" width="<?=$width?>" onMouseOver=" this.src='<?=$pic2name?>'; return escape('Image is of Parent Stock Only');"             onMouseOut="this.src='<?=$pic_name?>';"><br />
                           </a>

 

Any clues ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.