472,353 Members | 994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Javascript OnMouseOver Event not executing function inside it...

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
1 18697
This problem has been resolved. Working on drag effect of resizing controls.


den2005
Jul 13 '06 #2

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

Similar topics

0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a...
21
by: ryanmhuc | last post by:
I know the subject might be confusing. I am no beginner with javascript but I haven't been able to figure out how to get the javascript file name...
6
by: wimvan | last post by:
Hi, I'm a nerd in javascript, but, after trying and retrying I'm addressing me to help. I have a page with three frames, a top-, a left- and a...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the...
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the...
1
by: georgewbaba | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script...
6
by: Nathan Sokalski | last post by:
I have a DataList which contains several LinkButtons, which are used to select a category in my application. I want the currently selected category...
2
by: RobertTheProgrammer | last post by:
Hi, On an ASP.NET GridView, I have several LinkButton objects. I want to add the "onmouseover" event to the LinkButton so that I can perform a...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.