473,405 Members | 2,338 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,405 software developers and data experts.

Hide and show images by mouse event

Hi

I am developing an website. So in that i m trying to make like an image slide show. just like in www.habtoor.com. But i am using 3 buttons on leftside. 6 images are used for this 3 buttons. It means 2 images for each button. One ia on mouse over and anthor is on mouse out. Along with this, when mouse over on any particular button it displays the respective image on right side.so for right side i am using 3 images. when mouseover on any particular button on leftside it display an respective image by hiding other 2 images. so til this point i wrrten an code.
The code as shown below.

Expand|Select|Wrap|Line Numbers
  1. <!-- head part -->
  2. <!-- This script is for hide nd show images on right side -->
  3.  
  4. <script type="text/javascript" language="JavaScript">
  5. function HideDIV(d) 
  6. document.getElementById(d).style.display = "none"; 
  7. }
  8. function DisplayDIV(d)
  9.  { 
  10.  document.getElementById(d).style.display = "block"; 
  11.  }
  12.  </script>
  13.  
  14. <!--This script is for images used for button, I musing 2 images for each button(green nd white) --> 
  15.  
  16.  <SCRIPT LANGUAGE="JavaScript">
  17.  
  18. greenoverview = new Image();
  19. greenoverview.src = "http://bytes.com/images/iskanwap/green_over.jpg";
  20. whiteoverview = new Image();
  21. whiteoverview.src = "http://bytes.com/images/iskanwap/white_over.jpg";
  22.  
  23. greenconstruction = new Image();
  24. greenconstruction.src = "http://bytes.com/images/iskanwap/green_con.jpg";
  25. whiteconstruction = new Image();
  26. whiteconstruction.src = "http://bytes.com/images/iskanwap/white_con.jpg";
  27.  
  28.  
  29. greenreal = new Image();
  30. greenreal.src = "http://bytes.com/images/iskanwap/green_real.jpg";
  31. whitereal = new Image();
  32. whitereal.src = "http://bytes.com/images/iskanwap/white_real.jpg";
  33.  
  34. construction = new Image();
  35. construction.src = "http://bytes.com/images/iskanwap/green_over.jpg";
  36.  
  37. </script>
  38. <style type="text/css">
  39.  
  40.  
  41. #top-zone{overflow:visible; width:960px; margin:0 auto; height:20px;} /*Here to keep images hidden in IE mostly*/
  42. <!-- end of head part -->
  43.  
  44. <!-- Body part -->
  45. <!-- this is the body part, 1st <td> contain 1st button with 2 images --> 
  46.  
  47. <tr><td><span onmouseover="HideDIV('defaultDiv');HideDIV('constructionDiv');HideDIV('realDiv');DisplayDIV('overviewDiv')" onmouseout="HideDIV('defaultDiv');HideDIV('realDiv');HideDIV('constructionDiv');DisplayDIV('overviewDiv')"style="cursor:pointer"><a href="overview.php" onMouseOver="image1.src=greenoverview.src;" onMouseOut="image1.src=whiteoverview.src;"><img name="image1" src="http://bytes.com/images/iskanwap/white_over.jpg" border=:"0"></a></span></td>
  48.  
  49. <!-- this <td> tag contain right part images -->
  50.  
  51. <td rowspan="4">
  52. <div id="defaultDiv" class="mybox" style="background-image:url('images/iskanwap/over.jpg'); background-position:left; background-repeat:no-repeat; border:0"></div>
  53.  
  54. <div id="overviewDiv" class="mybox" style="display:none;":><span onmouseover="HideDIV('defaultDiv');DisplayDIV('overviewDiv')" style="cursor:pointer"><a href="overview.php"><img src="http://bytes.com/images/iskanwap/over.jpg" onmouseover="image1.src=greenoverview.src;" onmouseout="image1.src=whiteoverview.src;" border="0"/></span></div>
  55.  
  56. <div id="constructionDiv" class="mybox" style="display:none;":><span onmouseover="HideDIV('defaultDiv');HideDIV('overviewDiv')" style="cursor:pointer"><a href="construction.php" onMouseOver="image2.src=greenconstruction.src;" onMouseOut="image2.src=whiteconstruction.src;"><img src="http://bytes.com/images/iskanwap/CONSTRUCTION2.jpg" border="0" /></span></div>
  57.  
  58. <div id="realDiv" class="mybox" style="display:none;":><span onmouseover="HideDIV('defaultDiv');HideDIV('overviewDiv')" style="cursor:pointer"><a href="realestate.php" onMouseOver="image3.src=greenreal.src;" onMouseOut="image3.src=whitereal.src;"><img src="http://bytes.com/images/iskanwap/real_estate.jpg" border="0" /></span></div>
  59. </td>
  60. </tr>
  61.  
  62. <!-- below 2 row contain a 2 button--> 
  63.  
  64. <tr>
  65. <td><span onmouseover="HideDIV('defaultDiv');HideDIV('overviewDiv');HideDIV('realDiv');DisplayDIV('constructionDiv')" onmouseout="HideDIV('defaultDiv');HideDIV('overviewDiv');HideDIV('realDiv');DisplayDIV('constructionDiv')" style="cursor:pointer"><a href="construction.php" onMouseOver="image2.src=greenconstruction.src;" onMouseOut="image2.src=whiteconstruction.src;"><img name="image2" src="http://bytes.com/images/iskanwap/white_con.jpg" border=0></a></span></td>
  66. </tr>
  67. <tr>
  68.   <td><span onmouseover="HideDIV('defaultDiv');HideDIV('overviewDiv');HideDIV('constructionDiv');DisplayDIV('realDiv')" onmouseout="HideDIV('defaultDiv');HideDIV('overviewDiv');HideDIV('constructionDiv');DisplayDIV('realtDiv')" style="cursor:pointer"><a href="realestate.php" onmouseover="image3.src=greenreal.src;" onmouseout="image3.src=whitereal.src;"><img name="image3" src="http://bytes.com/images/iskanwap/white_real.jpg" border=0/></a></span></td>
  69. </tr>
  70.  
  71. <!-- End of body part -->
  72.  
Now what i want is when mouse out of all these images. It should behave like an slide show. By heightlighting an each button by changing the image of the button by keeping the other 2 button images same. Along with the respective image on right side.
Thankoyu. ANyone knows solution for my problem please help.
Apr 6 '11 #1
2 1792
johny10151981
1,059 1GB
Expand|Select|Wrap|Line Numbers
  1. <div style="cursor: pointer; color: white; width: 100px; height: 30px; line-height: 30px; font-weight: bold; background-image: url(webapp/gui/img/normal.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " 
  2.             align="center" onmouseover="this.style.background='url(webapp/gui/img/onmouseover.png)'" onmouseup="this.style.background='url(webapp/gui/img/onmouseover.png)'" onmousedown="this.style.background='url(webapp/gui/img/onclick.png)'" onmouseout="this.style.background='url(webapp/gui/img/normal.png)'" 
  3.             onclick="getStaticAction('Reports','SaveBankTranseferCharge','TransferCharge='+document.getElementById('TransferCharge').value+'&RecordId=<?=$DateRange?>',function(textReturn){if(textReturn=='failed') alert('Data Saving Failed'); else alert('Saved Successfully');});">Save</div>
  4.  
get the clue from here
Apr 7 '11 #2
Thanku for replying.
But i am using 6 images simultaniously when mouseout. Even in this also i want to hide some images respectively. That is what i am not getting. Please tel me how to do that one.
Apr 7 '11 #3

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

Similar topics

4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
2
by: Greg | last post by:
Hello, I am trying to display order ids and order details (order items). I would like to give the user Hide/Show option to either display or hide order details. The page would look like: ...
2
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This...
2
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). But seems mouse event will only fire once, and it seems changed to edit mode...
1
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). Hi, I need the MouseDown event be trigged everytime when press mouse in a...
0
by: lechatthierry | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
1
by: Neko | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
5
by: srampally | last post by:
I need the capabilty to hide/show a selection list, just the way its done at http://www.lufthansa.com (place the cursor over "Group Companies"). However, I am looking for a javascript that is much...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
3
by: wanwan | last post by:
I made a game with a window form that needs to record the mouse position to an array at 100 samples per second, so I use the mouse move event to do the job. The problem is the mouse move event...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.