Change Cursor Type & BackColor

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2008
Posts: 75
Reputation: mansi sharma is an unknown quantity at this point 
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Junior Poster in Training

Change Cursor Type & BackColor

 
0
  #1
Oct 12th, 2009
I want to change cursor type & backcolor when mouse moves over a td,Suppose I want to chnage the cursor to Hand, & backcolor to Blue on mouse move, & on mouse leave i want to change the cursor to default..How to do it?????????
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 51
Reputation: Dhaneshnm is an unknown quantity at this point 
Solved Threads: 6
Dhaneshnm's Avatar
Dhaneshnm Dhaneshnm is offline Offline
Junior Poster in Training
 
0
  #2
Oct 12th, 2009
The below code should solve the problem...
  1. <td
  2. onmouseover="style.backgroundColor='blue'" onmouseout="style.backgroundColor=''" style="cursor:pointer;">
  3. hi
  4. </td>
Last edited by Dhaneshnm; Oct 12th, 2009 at 11:54 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 75
Reputation: mansi sharma is an unknown quantity at this point 
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Junior Poster in Training
 
0
  #3
Oct 13th, 2009
Thx...
Thru JS
  1. <script type ="text/javascript" >
  2.  
  3. function onMouseMove()
  4. {
  5. document.getElementById("1").style.backgroundColor ="skyblue";
  6. document.body.style.cursor = 'hand';
  7. }
  8.  
  9. function onMouseLeave()
  10. {
  11. document.getElementById("1").style.backgroundColor ="";
  12. document.body.style.cursor = "default";
  13. }
  14. </script>
  15.  
  16. <td id="1" style="width: 98px; height: 46px;" onMouseOver="onMouseMove()" onMouseOut="onMouseLeave()">
  17. </td>
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 51
Reputation: Dhaneshnm is an unknown quantity at this point 
Solved Threads: 6
Dhaneshnm's Avatar
Dhaneshnm Dhaneshnm is offline Offline
Junior Poster in Training
 
0
  #4
Oct 13th, 2009
Better!!!!!!!!!!!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC