473,383 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 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 18819
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 that are directly on sys.path). If the script is...
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 "Module not found" error. This PEP aims to fix that...
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 from code inside the file. So you have an HTML...
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 right-frame. a kind a title-frmae, a button-frame...
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 onmouseover event it didn't work anymore....
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 onmouseover event it didn't work anymore....
1
by: georgewbaba | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script type="text/javascript"> function addpath(obj ,vari){ ...
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 to use a different CSS class. Here is an example...
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 javascript task-- in particular, to rewrite the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.