</>
Skip to content
jQuery lessons (39/39)

jQuery — Effects Reference

Basic Effects

MethodDescription
.hide()Hide element
.show()Show element
.toggle()Toggle visibility

Fading Effects

MethodDescription
.fadeIn()Fade in
.fadeOut()Fade out
.fadeToggle()Toggle fade
.fadeTo()Fade to opacity

Sliding Effects

MethodDescription
.slideDown()Slide down
.slideUp()Slide up
.slideToggle()Toggle slide

Custom Animation

MethodDescription
.animate()Custom properties animation
.stop()Stop current animation
.finish()Jump to end of all animations

Method Signatures

// Basic
$(selector).hide();
$(selector).show();
$(selector).toggle();

// With duration
$(selector).hide(400);
$(selector).show("slow");

// With callback
$(selector).hide(400, function() {
    console.log("Done");
});

// With easing
$(selector).animate({ left: "200px" }, 1000, "swing");

Speed Values

KeywordDuration
"slow"600ms
"normal"400ms
"fast"200ms

stop() Parameters

$(selector).stop(clearQueue, jumpToEnd);
// clearQueue: boolean - clear animation queue
// jumpToEnd: boolean - jump to end position

Practical Examples

// Accordion
$(".header").click(function() {
    $(this).next(".content").slideToggle(300);
});

// Fade gallery
$(".thumb").hover(
    function() { $(this).fadeTo(200, 0.7); },
    function() { $(this).fadeTo(200, 1); }
);

// Smooth scroll
$("a").click(function(e) {
    e.preventDefault();
    $("html").animate({ scrollTop: $($(this).attr("href")).offset().top }, 500);
});

Mini Practice

  1. Create a fade-in animation on page load
  2. Build an accordion with slideToggle
  3. Use animate() for custom movement
  4. Stop animations on hover

Up Next

Congratulations! You've completed the jQuery course. Continue exploring advanced jQuery patterns and modern alternatives.

Related Topics

Frequently Asked Questions about Effects Reference

What is Effects Reference in jQuery?

Effects Reference is a fundamental concept in jQuery. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Effects Reference?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Effects Reference.

Why is Effects Reference important in jQuery?

Effects Reference is essential for jQuery development. Understanding this concept will help you write better code and solve real-world problems more effectively.