Link to home
Start Free TrialLog in
Avatar of andreni78
andreni78

asked on

Smooth Show/Hide Effects? Is there a way?

Can anyone make the show/hide effect of this script smooth?

basically I want the content to have an animated crisp, smooth and fast drop down..

script will be available in next post..
Avatar of andreni78
andreni78

ASKER


<script>
var imgs=["http://www.opera.com/graphics/buttons/red_buy.gif","http://www.opera.com/graphics/buttons/red_dl.gif"]
function toggle(obj,nm)
{
     obj.src=obj.src==imgs[0]?imgs[1]:imgs[0];
     theDiv=document.getElementById(nm);
     theDiv.style.display=theDiv.style.display=="none"?"":"none";
}
</script>
Body:
<table border=0>
<tr>
     <td>
          <img src=http://www.opera.com/graphics/buttons/red_dl.gif onClick="toggle(this,'Arts')" border=0>
     </td>
</tr>
<tr>
     <td>
        <div id="Arts" style="position: relative; display:none;">
          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content          Some content         Some content         Some content
         Some content
     </div>
     </td>
</tr>
</table>
ASKER CERTIFIED SOLUTION
Avatar of m8rix
m8rix
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
very nice work!! but.. . it's not working right on my form.. it goes down smoothly but:

1. not fast enough
2. it makes my centered webpage turn to left indent
3. my form within the <div></div> is actually longer than what this script is set to go down... so it stops abruptly...

so if you could make this script relative to it's surroundings.. that would be fantastic.. and no grays please =)

looks like u spent a lot of time writing this script.. so i'll make another post requesting fixes...
Thanks for the feedback, as you may have probably noticed I have been away for a month. Is everything in order now or do you still require some assistance?