您的位置:首页 > Web前端 > JQuery

用jQuery实现具有伸缩功能的动画图片

2015-08-14 15:01 711 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>chainning code</title>
<script language="javascript" src="jquery-1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){

$("#show").click(function () {
var n = $("div").queue("fx");
$("span").text("Queue length is: " + n.length);
});
function runIt() {
$("div").show("slow");
$("div").animate({left:'+=0'},5000);
$("div").animate({left:'-=0'},1000);
$("div").hide("slow");
}
runIt();
});
</script>
<style>
div { margin:3px; width:1000px; height:500px;
position:absolute; left:0px; top:0px;
background:green; display:none; }
div.newcolor { background:blue; }
span { color:red; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<div  id="show" class="panel"><img name="" src="b.jpg" width="1000" height="500" alt="美女" /></div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jquery