标签:
推荐网址:http://www.php100.com/manual/jquery/,用法教学,包括实例。
分类:显示隐藏、淡入淡出、滑动、自定义。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script src="Scripts/jquery-1.10.2.min.js"></script> <script> function show() { var obj = $("#div1"); obj.toggle(); } function slide() { var obj = $("#div1"); obj.slideToggle(); } function fade() { var obj = $("#div1"); obj.fadeToggle(); } function showEvg() { var obj = $("#div1"); //obj.toggle(4000); //4s //obj.toggle("slow"); //600ms //obj.toggle("normal"); //obj.toggle("fast"); //200ms //obj.toggle(4000, function () { // alert(‘ok‘); //执行结束弹出ok //}); //obj.animate({ "width": "100px", "height": "100px", "opacity": "toggle" }, "fast", function () { }); //obj.animate({ "width": "100px", "height": "100px", "opacity": "show" }, 1000, function () { }); //obj.stop(); //obj.finish();//停止当前正在运行的动画,删除所有排队的动画,并完成匹配元素所有的动画。 //obj.slideUp(300).delay(800).fadeIn(400);//在.slideUp() 和 .fadeIn()之间延时800毫秒。 } </script> </head> <body> <form id="form1" runat="server"> <div style="width: 500px; height: 200px; background-color: green;" id="div1"> </div> <input type="button" value="点击我show" onclick="show()" /> <input type="button" value="点击我slide" onclick="slide()" /> <input type="button" value="点击我fade" onclick="fade()" /> <input type="button" value="点击我showEvg" onclick="showEvg()" /> </form> </body> </html>
标签:
原文地址:http://www.cnblogs.com/ligenyun/p/5951421.html