x

How to Animate a DIV From Display None to Block in jQuery

by Kevin Lee

Cascading Style Sheets help site developers show, hide and animate objects on a website. If your page has a hidden DIV element, you can use JavaScript to make that DIV appear gradually by changing its display style from "none" to "block" using a timer. It takes a little programing knowledge to make that happen. Using jQuery, a cross-browser JavaScript library, you can generate this impressive fade-in effect using a single line of code.

Step 1

Navigate to jQuery's website and view their jQuery code. It appears inside your browser window. Click your browser's "File" menu, and then click "Save As." The "Save As" window opens. This window displays the folders located on your hard drive.

Step 2

Locate the folder that contains an HTML document you would like to use for testing. Double-click that folder to open it, and then click "Save" to save the jQuery file to that folder.

Step 3

Launch an HTML editor or Notepad. Open your HTML document, and paste the following code into the document's "head" section:

Video of the Day

Brought to you by Techwalla
Brought to you by Techwalla

More Articles