Advertisement

06.25.2008 at 02:18AM PDT, ID: 23513755
[x]
Attachment Details

Div contents to appear or disappear gradually

Asked by Dada44 in JavaScript, Cascading Style Sheets (CSS), Asynchronous Javascript and XML (AJAX)

Tags: Javascript, CSS, Ajax, IE, FireFox, Safari

Dear all,

I have the scrip below that shows or hides the divMain contents if you put the mouse over some text.
Now the contents appear or disappear abruptly, and I would like them to show or hide gradually,  with certain opacity. How can it be done??

Also, I have to place the mouse over the "***Show or hide divMain***" text in order to make the script work.
Could it be possible to place the mouse over the div (divMain) to make it show or hide???

Thanks a million in advance!!!!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
<head>
   <script type="text/javascript" language="JavaScript"><!--
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}
//--></script>
  </head>
  <body>
 
 
<a onmouseover="ReverseContentDisplay('divMain'); return true;"
   href="javascript:ReverseContentDisplay('divMain')">
***Show or hide divMain***
</a>
 
<br><br>
<div id="divMain">
I have a picture and some text here in divMain <br><img src="picture.jpg">
</div>
  </body>
 
 
[+][-]06.25.2008 at 07:23AM PDT, ID: 21865898

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Cascading Style Sheets (CSS), Asynchronous Javascript and XML (AJAX)
Tags: Javascript, CSS, Ajax, IE, FireFox, Safari
Sign Up Now!
Solution Provided By: x_com
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628