jquery slide

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
19,534
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 28, 2009

This is a quick tutorial of how you can use jquery to make some cool animation effects. It just using the slideToggle and some added CSS3 rounded corners to make it look even better.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (optikalefxx)

  • you should get notepad++ (unless you already have)

  • @MrMaestro14231 i use textwrangler on the mac. It blows notepad++ out of the water

  • Could you please help with this, I was able to change it so that instead of when you hover over it and it slides down, you have to click it. I achieved this by changing .hover() to .click(). However how could I make the header change to a different color when the box is showing, and back to orange when the tab isn't. Please help, I'm new to JQuery.

  • @pstap92 So what you need to do is in the click, select the tab with jquery and run .css("background-color","blue"­)

    and then for making it go back, whenever it slides back up, also have it select the tab and do .css("background-color","orang­e")

    If you send me code I can show you with your code.

  • @optikalefxx I can make it change color, however I can't get it to change back.

  • @pstap92 your hover must not be right. make sure you have the right syntax for the hover method.

    you can always use mouseover and mouseout as separate functions instead of hover.

Top Comments

  • @c532869 This makes me smile.

    Screw microsoft.

see all

All Comments (49)

Sign In or Sign Up now to post a comment!
  • I tried putting an image link inside the box, but when I hover over it the image shows up in the div before the box actually slides down. Any suggestions?

  • 3:26 Wrong..... border-radius:12px; works in all versions of IE.(maybe not all, but you get me).

  • @optikalefxx yeah truly, i agree with u fully, i mean dear Gawd,, if u can program jquery why would u use IE8.. or IE in any universe or for any reason even as an end user... most people are finally adapting to firefox atleast and samsung is pushing the google browsing concept... so im sure 2 years from now everything will be a ok for any scripts.. screw IE9 aswell... go chrome or go home.. yay for safari and dnt run with the flocks get firefox... lol.. thanks for the awesome tut.

  • @pbsallad Youre right

  • I don't know if any one has pointed this out, but the CSS for rounding corners in Firefox is wrong. It's supposed to be -moz-border-radius-topleft: -moz-border-radius-topright: and so on and so on. Other than that, great stuff. Thanks for the tut. :)

  • @optikalefxx Amin

  • @giantsfan245 - using a click handler instead of hover seems more user-friendly to me. Then the code would be shortened to just:

    $('.header').click(function () {

    $('.box').slideToggle();

    });

  • This looks cool but there's gotta be a better way to do it. You're using slideToggle() twice and it's already a toggle, so using it twice seems redundant. I would think it would be better to have slideDown() for the first hover function argument then slideUp() for the second. It does the same thing but seems more correct in terms of the jquery method used.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more