html文件里的before,jquery中html、before、after、append、prepend应用

jquery_slip.html

$(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

There is the function slipUp and slipDown test.

slideUp

slideDown

animate

reset

html application into jquery.

htmltest

htmlreset

htmlappend

htmlafter

htmlbefore

htmlprepend

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值