The jQuery library contains the following features:
There are lots of other JavaScript frameworks out there, but jQuery seems to be the most popular, and also the most extendable.
Many of the biggest companies on the Web use jQuery, such as:
There are two versions of jQuery available for downloading:
Both versions can be downloaded from jQuery.com
If you don't want to download and host jQuery yourself, you can include it from a CDN (Content Delivery Network).
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
The jQuery syntax is tailor made for selecting HTML elements and performing some action on the element(s).
Basic syntax is: $(selector).action()
$(this).hide() //hides the current element.
$("p").hide() //hides all <p> elements.
$(".test").hide() //hides all elements with class="test".
$("#test").hide() //hides the element with id="test".
Examples: jQuery uses CSS syntax to select elements
The Document Ready Event method allows us to execute a function when the document is fully loaded
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
The on() method attaches one or more event handlers for the selected elements:
$("p").on("click", function(){
$(this).hide();
});
// Or
$("p").on({
mouseenter: function(){
$(this).css("background-color", "lightgray");
},
mouseleave: function(){
$(this).css("background-color", "lightblue");
},
click: function(){
$(this).css("background-color", "yellow");
}
});
With jQuery, you can chain together actions/methods.
Chaining allows us to run multiple jQuery methods (on the same element) within a single statement.
To chain an action, you simply append the action to the previous action.
$("#p1")
.css("color", "red")
.slideUp(2000)
.slideDown(2000);
jQuery contains powerful methods for changing and manipulating HTML elements and attributes.
remove() - Removes the selected element (and its child elements)
empty() - Removes the child elements from the selected element
The css() method sets or returns one or more style properties for the selected elements.
jQuery traversing, which means "move through", are used to "find" (or select) HTML elements based on their relation to other elements. Start with one selection and move through that selection until you reach the elements you desire.
Three useful jQuery methods for traversing up the DOM tree are:
A descendant is a child, grandchild, great-grandchild, and so on.
With jQuery you can traverse down the DOM tree to find descendants of an element.
Two useful jQuery methods for traversing down the DOM tree are:
Siblings share the same parent.
There are many useful jQuery methods for traversing sideways in the DOM tree:
The three most basic filtering methods are first(), last() and eq(), which allow you to select a specific element based on its position in a group of elements.
Other filtering methods, like filter() and not() allow you to select elements that match, or do not match, a certain criteria.
http://jquery.com/ jQuery Official site
http://jquery-docs.ru/ Русская документация по jQuery
http://habrahabr.ru/hub/jquery/ Интересные публикации / Хабрахабр
Use only jQuery for layout and adding styles
Create such article block
The layout is changing according to window size
Create Dropdown top menu
Hover
Click
Hover menu item
Use only jQuery events