原文来自: http://www.w3school.com.cn/jquery/jquery_effects.asp
1.显示和隐藏
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p id="p1">如果点击“隐藏”按钮,我就会消失。</p>
<button id="hide" type="button">隐藏</button>
<button id="show" type="button">显示</button>
</body>
</html>
2.切换
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<button type="button">切换</button>
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</body>
</html>
3. 滑动函数 slideToggle, slideUp,slideDown
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".flip").click(function(){
$(".panel").slideDown("slow");
});
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>W3School - 领先的 Web 技术教程站点</p>
<p>在 W3School,你可以找到你所需要的所有网站建设教程。</p>
</div>
<p class="flip">请点击这里</p>
</body>
</html>
4. fade函数
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("div").fadeTo("slow",0.25);
});
});
</script>
</head>
<body>
<div id="test" style="background:yellow;width:300px;height:300px">
<button type="button">点击这里查看淡出效果</button>
</div>
</body>
</html>
5.自定义动画
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#start").click(function(){
$("#box").animate({height:300},"slow");
$("#box").animate({width:300},"slow");
$("#box").animate({height:100},"slow");
$("#box").animate({width:100},"slow");
});
});
</script>
</head>
<body>
<p><a href="#" id="start">Start Animation</a></p>
<div id="box"
style="background:#98bf21;height:100px;width:100px;position:relative">
</div>
</body>
</html>
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#start").click(function(){
$("#box").animate({left:"100px"},"slow");
$("#box").animate({fontSize:"3em"},"slow");
});
});
</script>
</head>
<body>
<p><a href="#" id="start">Start Animation</a></p>
<div id="box"
style="background:#98bf21;height:100px;width:200px;position:relative">
HELLO
</div>
</body>
</html>
分享到:
相关推荐
jquery高亮图片框 jquery图片展示 jquery效果很好
jquery效果程序包,jquery效果程序包,jquery效果程序包
左侧导航 jquery效果
jquery效果经典效果
多种网页jQuery效果.有demo实例。
jquery效果jquery效果jquery效果
JQUERY 效果 包1JQUERY 效果 包1
常用的jquery 插件. 漂亮的jquery 效果
网站常用jquery效果 jquery控件 包括 日历控件、tab控件、进度调、对话框、窗口弹出等效果 /jquery-ui-1.8.4.custom/development-bundle/demos/index.html 从这里进入
仿淘宝商城焦点图的jQuery效果,实用,效果很棒的
仿淘宝商品列表js展示效果 jquery效果 ajax效果.zip 仿淘宝商品列表js展示效果 jquery效果 ajax效果.zip 仿淘宝商品列表js展示效果 jquery效果 ajax效果.zip 仿淘宝商品列表js展示效果 jquery效果 ajax效果.zip 仿...
jquery效果走廊模式3D展览图片展示 演示地址 http://www.whkge.com/jsview/design20110828b/
jquery效果js效果内容自动分页,同时两个分页效果同时适用 效果页面:http://www.whkge.com/jsview/design20110828a/
仿京东 鼠标放上去 图片左右移动jquery效果
幻灯片效果的jquery效果
这是本人收藏的强大的jquery效果插件。
jQuery效果源码.rar,很好的,希望大家喜欢
50个jquery效果源码,js特效,指向滑动按扭,选项卡,选项卡切换,手风琴效果,图片的缩放,相片画廊,淡化效果,水平或垂直的列表,拾色器,高亮图片框,验证规则,表单Check样式,星形评级系统,多功能表格,拖拽插件,拖拽树形菜单...
json + struts2 + 80个JQuery 效果 个例子
最新jquery效果。。。。。。。。。。。。。。。。。。