$(function () {
$("#btntest").toggle(function () {
$("div").hide()
},function () {
$("div").show()})
});
$("#btntest").toggle(function () {
$("div").hide()
},function () {
$("div").show()})
});
2015-09-09
var json1=[
{"name":"a","height":"170"},
{"name":"b","height":"180"},
];
$.each(json1,function(i){
$("ul").append("<li>name:"+json1[i].name+" ,height:"+json1[i].height+"</li>")
})
{"name":"a","height":"170"},
{"name":"b","height":"180"},
];
$.each(json1,function(i){
$("ul").append("<li>name:"+json1[i].name+" ,height:"+json1[i].height+"</li>")
})
$(".red,.green").html("hi,我们的样子很美哦!");
$(".blue").html("选我吧! 我是bule");
$(".blue").html("选我吧! 我是bule");
2015-09-08
$("#content").css({"background":"red","color":"#fff"});
2015-09-08
g刚才搞错了左右。。。
<scripttype="text/javascript">
$(document).ready(function(){
$("button").each(function(){
$(this).bind("click",function(){
$("div").animate({
left:$(this).html().indexOf("右")>=0?"+=50px":"-=50px"
},3000);
})
});
});
</script>
<scripttype="text/javascript">
$(document).ready(function(){
$("button").each(function(){
$(this).bind("click",function(){
$("div").animate({
left:$(this).html().indexOf("右")>=0?"+=50px":"-=50px"
},3000);
})
});
});
</script>
<scripttype="text/javascript">
$(document).ready(function(){
$("button").each(function(){
$(this).bind("click",function(){
$("div").animate({
left:$(this).html().indexOf("左")>=0?"+=50px":"-=50px"
},3000);
})
});
});
</script>
$(document).ready(function(){
$("button").each(function(){
$(this).bind("click",function(){
$("div").animate({
left:$(this).html().indexOf("左")>=0?"+=50px":"-=50px"
},3000);
})
});
});
</script>
$(function(){
$("div:contains('jQuery')").css("background", "green");//你们没注意这里也有吧,:)
$("li:contains('jQuery')").css("background", "green");
})
$("div:contains('jQuery')").css("background", "green");//你们没注意这里也有吧,:)
$("li:contains('jQuery')").css("background", "green");
})
2015-09-08
楼下那位同学,这题目的答案是固定死的,它会校验,所以必须和老师给出的效果一样才行哦(话说这不能回复评论啊==!还是我没找到~)
2015-09-08