Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
    • code notes
Blog Web Dev jQuery Effects

jQuery Effects

By Forrest Smith - Drempd.com

Many effects are made easy with jQuery:

Hiding and Showing

hide
Hides an html element, for example:

$('menu_sub').hide();

show
Shows an html element:

$('menu_sub').show();

toggle
Switches and elements display — if hidden, it displays it, if it\’s currently displayed, it hides the element.

$('menu_sub').toggle();

fadeIn
In the code below, the ‘500’ is the speed in milliseconds for the fade in to occur. Specifying the speed is optional.

$('menu_sub').fadeIn(500);

fadeOut
In the code below, the ‘500’ is the speed in milliseconds for the fade out to occur. Specifying the speed is optional.

$('menu_sub').fadeOut(500); 

fadeToggle
In the code below, the ‘500’ is the speed in milliseconds for the fade out to occur. Specifying the speed is optional.

$('menu_sub').fadeToggle(500);

slideDown
In the code below, the ‘500’ is the speed in milliseconds for the fade out to occur. Specifying the speed is optional.

$('menu_sub').slideDown(500);

slideUp
In the code below, the ‘500’ is the speed in milliseconds for the fade out to occur. Specifying the speed is optional.

$('menu_sub').slideUp(500);

slideToggle
In the code below, the ‘500’ is the speed in milliseconds for the fade out to occur. Specifying the speed is optional.

$('menu_sub').slideToggle(500);

animate
Allows changing any property of an element that accepts a numeric value.

Calling Multiple Effects

To call multiple effects, just line them call them all on one line. Each will wait for the previous effect to finish before beginning:

$('#myphoto').fadeIn(1000).fadeDelay(3000).fadeOut(1000);
Posted on June 25, 2012August 27, 2022 in Web Dev
  • Web Dev

    • css
    • git
    • handlebars
    • html
    • inkscape
    • photoshop
    • php
    • sass
    • web design
    • web development

drempd | san diego, ca


home contact

adventures san diego projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance