JQuery Nuts and Bolts
a quick entry, the loader graphic
Categories: JQuery
The infamous spinner as done by JQuery:
Create a div that contains the image that you want to use as a "loader" image.
<div id="loader"> <img alt="" src="path/to_graphic" /> </div>
It just takes a small piece of Javascript (JQuery) to make the magic happen
$('#loader').hide() //this initially hides the div .ajaxStart(function(){ $(this).show(); // show the div when the Ajax call starts )} .ajaxStop(function(){ $(this).hide(); //hide the div when the Ajax call stops )};Place the loader div within the div that's receiving the results of the ajax call, and JQuery code with the rest of your JQuery code and you have a quick and dirty loader
Posted by admin at 12:00 AM | Link | 0 comments
Comments
No comments found.
Post a comment (login required)