Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SlideUp Slide down automatically

Posted on 2008-10-14
2
Medium Priority
?
2,366 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

610 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