jQuery Tutorial


jQuery Example


jQuery References


jQuery with CSS References




jQuery with CSS Methods

All jQuery CSS method are listed here. All jQuery CSS method work on some different purpose. which you have to binding with your program.

CSS Method Description
addClass()
Use Add one or more CSS class to selected elements.
Syntax $(selector).addClass(classname)
parameter classname is Required parameter. add one or more css class names.
Example $("p").addClass("param");
css()
Use set one or more style properties value into selected elements.
Syntax $(selector).class(name,value)    or
$(selector).css({property:value,property:value, ...})
parameter name is Required parameter. name define the css properties.
value is required parameter. value define specific value assing the name.
Example $("p").css("background-color","pink");      or
$("p").css({"background-color":"pink","font-size":"20px"});
hasClass()
Use Checks for selected element is specify by Class.
Syntax $(selector).hasClass()
Example alert($("p").hasClass("param"));
height()
Use Set and return the height of selected elements.
Syntax $(selector).height(value)      or
$(selector).height()
Example $("p").height("100px"));      or
alert($("p").height());
offset()
Use Set and Returns the relative position for selected elements.
Syntax $(selector).offset(value)      or
$(selector).offset()
Example $("p").offset(left:20,top:100));      or
alert($("p").offset());
position()
Use Returns the relative position for selected element.
Syntax $(selector).position()
Example $("p").position();
removeClass()
Use Removes one or all class from selected elements.
Syntax $(selector).removeClass(classname)
parameter classname is Required parameter. remove one or all css class.
Example $("p").removeClass("param");
toggleClass()
Use Toggles add or remove one or more class from selected elements.
Syntax $(selector).toggleClass(classname)
parameter classname is Required parameter. add one or more css class names.
Example $("p").toggleClass("param");
width()
Use Set and return the height of selected elements.
Syntax $(selector).width(value)      or
$(selector).width()
Example $("p").height("200px"));      or
alert($("p").width());