So, what's the big deal of this tiny (22kb) little .js file?
The design of the library is just gorgeous. The basic principle is very simple:
- Select the desired objects
- Perform some action on them
$('#this_is_the_id').hide();
In this case an object with the ID this_is_the_id is selected and hidden.
$("#orderedlist > li").addClass("blue");
I this example, the CSS class "blue" is added to all child elements of an ordered list.
$(document).ready(function() {
...
}
Here some code can be placed which is executed as soon as the DOM structure of the document has finished loading - so no more onLoad events which can have a huge delay because of e.g. external images or advertising stuff.
Here you can find some more tutorials on this.
No comments:
Post a Comment