Posts

Showing posts from July, 2018

Create Animations & Effects using jQuery

Background:  We so far have seen different ways to manipulate the DOM . While manipulating DOM elements we can add some basic effects to make the UI more attractive. There are built-in methods that jQuery provides to achieve different effects and simply calling those methods against different selectors we can easily create the animations. Using jQuery we can fade/slide an element using in-built methods. There are ways to create custom animations and add a callback function and to stop the animation whenever required. Let's look briefly about how we can create basic effects using these methods. Hide,Show & Toggle methods: One of the most basic effect we can have using jQuery is to hide/show certain element. In order to hide/show DOM element jQuery provides two method hide() and show(). So to hide/show a particular div we will use : $("#div1").hide();//hides the element with id "div1" $("#div1").show(); //shows the element with id "