Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Part 4.2jQuery slide animations

Part 4.2jQuery slide animations

As an extension of the previous tutorial in this course, this tutorial will continue to exemplify some of the basic built-in animations (which are often very helpful).

slideUp & slideDown

The jQuery slideUp and slideDown methods are used to make an element slide up or down. The example below shows one of the 'zones' on this website as an example of what it can do:

jQuery as a library

jQuery is a popular library for element manipulation in JavaScript.

There are many things you can do with jQuery and it is not just limited to animation.

The jQuery slideUp method can be combined with the slideDown function

JavaScript
jQuery("#main_image_display").slideUp();
JavaScript
jQuery("#main_image_display").slideDown();

slideToggle

Much like with the previous tutorial, slide features can be toggled. This example binds a function to the click event on the button in the preview which triggers the slideToggle on the main image:

JavaScript
jQuery("#slider_button").on("click", function() {
	jQuery("#main_image_display").slideToggle();
});
Feedback 👍
Comments are sent via email to me.