Solved

SlideUp Slide down automatically

Posted on 2008-10-14
2
2,346 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

808 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