$(function(){$("#but").bind("click",function(){var $this = $(this);$.getJSON("b.json", function(data){$this.attr("disabled","true");$.each(data,function(index,b){if(index==1);$("ul").append("<li>名字:"+b.name+"</li>"+"<li>年龄:"+b.age+"</li>"+"<li>性别:"+b.sex+"</li>");});});})});</script>
<div id="zhang">
<div class="yu">
<span class="fl">我是第一次耍Ajax</span>
<span class="fr">
<input name="jz" type="button" id="but" value="加载" />
</span>
</div>
<ul></ul>
</div>
<div class="yu">
<span class="fl">我是第一次耍Ajax</span>
<span class="fr">
<input name="jz" type="button" id="but" value="加载" />
</span>
</div>
<ul></ul>
</div>
(function(){
$.extend({"changeBg":function(nd){
$(nd).hasClass("on")?$(nd).removeClass("on"):$(nd).addClass("on");
}});
})(jQuery)
$(function(){
$("ul li").hover(function(){$.changeBg($(this));});
});
$.extend({"changeBg":function(nd){
$(nd).hasClass("on")?$(nd).removeClass("on"):$(nd).addClass("on");
}});
})(jQuery)
$(function(){
$("ul li").hover(function(){$.changeBg($(this));});
});
2016-06-08
$("#name").tooltip({ show: { effect: "slideDown", delay: 200}, hide: { effect: "slideUp",delay: 200},position: {my: "left top+10",at: "left bottom" }});
2016-06-08
属性值中的‘’单引号可以不写,由于属性名与属性值是等号,因此,它们之间不是包含关系,而是完全相同。
2016-06-08