Solved

SlideUp Slide down automatically

Posted on 2008-10-14
2
2,352 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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