Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi all,
i am try to do a mouseover event in php but unable to this.
This the code working fine..
HTML
<div id="main-icon">
<div class="main-icon-left">
 <a href="../index.php"><img src="pb-images/icon-right.png" width="49" height="47" border="0" name="icon right"  alt="icon right" title="icon right" onMouseOver="this.src = 'pb-images/icon-right-hr.png';"  önMouseOut="this.src = 'pb-images/icon-right.png';"></a>
</div>
<div class="main-icon-right"> <a href="machines/binding.php"><img src="pb-images/icon-left.png" width="49" height="47" border="0" name="icon right"  alt="icon right" title="icon right" onMouseOver="this.src = 'pb-images/icon-left-hr.png';"  önMouseOut="this.src = 'pb-images/icon-left.png';"></a></div>
</div>


But using this code in php
PHP
<div id='main-icon'>
<div class='main-icon-left'>
 <a href='../index.php'><img src='pb-images/icon-right.png' width='49' height='47' border='0' name='icon right'  alt='icon right' title='icon right' onMouseOver='this.src = 'pb-images/icon-right-hr.png';'  önMouseOut='this.src = 'pb-images/icon-right.png';'></a>
</div>
<div class='main-icon-right'> <a href='machines/binding.php'><img src='pb-images/icon-left.png' width='49' height='47' border='0' name='icon right'  alt='icon right' title='icon right' onMouseOver='this.src = 'pb-images/icon-left-hr.png';'  önMouseOut='this.src = 'pb-images/icon-left.png';'></a></div>
</div>";

In this the onmouseOver and onmouseOut not working..
If anybody have any idea related to this then please Let me know ASAP

thanks
Posted

Check your colon an semicolon in mouse out event handler declaration. You can even see it here on CPwhat is wrong :)
 
Share this answer
 
Comments
[no name] 19-Nov-12 2:30am    
thanks
I did not get you?
i have put all there is no error coming but event not firing.

Can you send the code what you want to say.
n.podbielski 19-Nov-12 3:25am    
Look closely to your second code snippet. Is entire code for handle in handler placeholder? HINT: is in BLUE as html attribute should be? Or it is ending at some point and it is RED?

And I really suggest you to use web browser console to chceck for errors like this. It will save you tons of time.
Hi all,
i found the ans just change the code with this
PHP
<img src="../../pb-images/icon-left.png" width="49" height="47" border="0" name="icon right" alt="icon right" title="icon right" onmouseover="\"this.src" this.src="../../pb-images/icon-left.png" hold=" /><br mode="></img>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900