Solved

SlideUp Slide down automatically

Posted on 2008-10-14
2
2,340 Views
Last Modified: 2013-11-11
I'm trying to use script.aculo.us to slide up/down a panel - I want to use the same area to drop it down if it's up, and vice versa.  Is there a built in way to do this?  I've got the following hack working, but it's kinda ugly.

<div onclick="if (contDown) Effect.SlideUp('content', { duration: 0.5 }); else Effect.SlideDown('content', { duration: 0.5 }); contDown = !contDown;">
0
Comment
Question by:ARACK04
2 Comments
 
LVL 7

Accepted Solution

by:
mltsy earned 500 total points
ID: 22717927
I'd say that's about as concise as you're going to get (give or take a few characters).  If you aren't using scriptaculous for too much else, you could try Mootools.  Not to steal users from scriptaculous, but I have had a better experience so far with Mootools, and it has a toggle function exactly like what you're looking for :) ...

http://mootools.net/docs/Plugins/Fx.Slide#Fx-Slide:toggle
0
 

Author Comment

by:ARACK04
ID: 22718068
scriptaculous is built into rails, so I'll stick with it.  Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now