Home  >  Article  >  Web Front-end  >  Summary of common jquery operations_jquery

Summary of common jquery operations_jquery

WBOY
WBOYOriginal
2016-05-16 16:41:42985browse

Page load method

$().ready(function() {

})

div hiding operation

// div是否隐藏
function isHideMenu(){
return $("#menuContent").is(":hidden")
}
// 隐藏div
mainFrameset.hide();
// 显示div
mainFrameset.show();

Get object

//通过id获得
$("#menuContent");
//通过class获得
$(".menuContent");

Property settings

// 设置value
$("#menuContent").val("value");
// 设置css
$(".handle").css("marginLeft",5);
// 设置属性
$("img").attr("width","180");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn