By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

Javascript OnMouseOver Event not executing function inside it...

P: 5
Hi everybody,

I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance.

Code working:
Expand|Select|Wrap|Line Numbers
  1. <form id="form1" runat="server">
  2.     <div>
  3.         &nbsp;</div>
  4.     <div>
  5.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  6.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  7.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  8.             <img src="images/rock.jpg" id="Img3" onmouseover="this.style.cursor='w-resize" /><br /><br />  <<--- working ok
  9.             <input id="Button3" type="button" value="button" /><br />            
  10.         </asp:Panel>  
  11.         ....  
  12. </form>
  13.  
Code Not working:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage()
  4.          {
  5.             document.getElementById('Img3').style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage()" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage(obj)
  4.          {
  5.             obj.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage(this)" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage(var obj)
  4.          {
  5.             obj.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage(this)" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage()
  4.          {
  5.             document.body.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10.  
  11. <form id="form1" runat="server">
  12.     <div>
  13.         &nbsp;</div>
  14.     <div>
  15.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  16.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  17.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  18.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage()" /><br /><br />  <<--- not working ok
  19.             <input id="Button3" type="button" value="button" /><br />            
  20.         </asp:Panel>  
  21.         ....  
  22. </form>
  23.  

den2005
Jul 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: 5
This problem has been resolved. Working on drag effect of resizing controls.


den2005
Jul 13 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.