Riparian Posted January 31, 2014 Share Posted January 31, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/ Share on other sites More sharing options...
Ch0cu3r Posted January 31, 2014 Share Posted January 31, 2014 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> Quote Link to comment https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/#findComment-1467198 Share on other sites More sharing options...
Riparian Posted February 1, 2014 Author Share Posted February 1, 2014 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/#findComment-1467320 Share on other sites More sharing options...
Riparian Posted February 3, 2014 Author Share Posted February 3, 2014 Can anyone help me out here ? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/#findComment-1467488 Share on other sites More sharing options...
Ch0cu3r Posted February 3, 2014 Share Posted February 3, 2014 Maybe doing something like this. Creating a popup on the fly with JavaScript http://jsfiddle.net/jhB6G/1/ Quote Link to comment https://forums.phpfreaks.com/topic/285820-return-2-actions-from-onmouseover/#findComment-1467584 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.