Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 6th, 2007, 02:13 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do i make my divs slide?

Hi guys, i have written a very basic javascript function so that when you click on a button selected divs either display or dissappear (see below).

<script language="javascript">

var divs=['header', 'middle', 'footer'];

function displaydiv()
{

for (var x=0;x<divs.length;x++)
  {
  document.getElementById(divs[x]);
  if (document.getElementById(divs[x]).style.display=='block')
  {
     document.getElementById(divs[x]).style.display='none';
  }
  else
  {
     document.getElementById(divs[x]).style.display='block';
  }
  }
}
</script>

Is there anyway i can make these divs slide out rather than appear instantly? This would just make it look that little bit better. Someone mentioned that i could do this using javascript. Any ideas?

Cheers in advance

Will

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt slide show kawlaelo XSLT 6 February 13th, 2007 10:41 AM
divs inside divs: theory? Giant_robot_sandwich CSS Cascading Style Sheets 11 September 13th, 2006 03:56 PM
Image slide-show Rajarshi HTML Code Clinic 1 February 27th, 2006 06:03 AM
Slide Show #1 (New User) WebDevel Javascript How-To 1 March 15th, 2005 09:58 AM



All times are GMT -4. The time now is 02:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.