jquery
共 2 篇文章
让元素居于body的中部
$(window).load(function() { var p = $("#addDir"); var offset = $("body").offset(); var body = $("body"); /*居中*/ p.css("top",offset.top + (body.height() - p.height())/2); p.css("left",offset.left + (body.width() - p.width())/2); });
2009-04-20 10:55 · jquery · CSS
jquery常见用法
$(a,b) a:用来查找的字符串 b:用来查找的范围(上下文) 例:$("input:radio", document.forms[0]) 在文档的第一个表单中,查找所有的单选按钮(即: type 值为 radio 的 input 元素)。 $(attribute,value) 例:$("input[name='newsletter']").attr("checked", true); $("input[name!='newsletter']").attr("checked", true); $(a).hide(),$(a).show()
2009-04-01 16:10 · jquery · jQuery