$(document).ready(function(){
$("div.show").click(function(){
$("div.content").slideToggle("slow");//不写默认为normal,后面函数一致
// $("div.show").slideUp();
});
});
//注意选择标签不能忘记加"",否则动作不起作用
$(document).ready(function(){
//hide and show function test
$("#hide_button").click(function(){
$("#hide_show_content").hide("slow",function(){
alert("The content is hided.");
});
});
$("#show_button").click(function(){
$("#hide_show_content").show("slow",function(){
alert("The content is showed.");
});
});
//slideUp and slideDown function test
$("button.slideUp").click(function(){
$("p.slide_content").slideUp("slow");
});
$("button.slideDown").click(function(){
$("p.slide_content").slideDown("slow");
});
//animate and reset test
$("button#animate").click(function(){//可以直接用标签名调用id
$("#box").animate({height:"30px"});
});
$("#reset").click(function(){
$("#box").animate({height:"10px"});
});
//html application,其中可以加入内容页可以直接加入html标签内容
$(".html").click(function(){
$(".htmlContent").html("The html content.");
});
$(".htmlreset").click(function(){
$(".htmlContent").html("html application into jquery.");
});
$(".htmlappend").click(function(){
$(".htmlContent").append("append content.");
});
$(".htmlafter").click(function(){
$(".htmlContent").after("after content.");
//这里不能直接用函数
// $("html.after").after(function(){
// alert("You have add content after html content.");
// });
});
$(this).click(function(){//也可以直接用this
$(".htmlContent").before("before content",function(){
alert("You have add content before html content.");
});
});
$(".htmlprepend").click(function(){
$(".htmlContent").prepend("html prepend content.");
});
});
We are friends.
We can do everything if you want. Do it by yourself.
Don't tell it can not be done.
click here to show content.
There is the function hide and show test.
hide
show
slideUp
slideDown
animate
reset
html application into jquery.
htmltest
htmlreset
htmlappend
htmlafter
htmlbefore
htmlprepend