您当前的位置: 首页 >  动画

暂无认证

  • 0浏览

    0关注

    101061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

[JQ权威指南]移动位置的动画

发布时间:2016-07-05 10:06:52 ,浏览量:0

 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>移动位置的动画title> <script type="text/javascript" src="../jquery-2.1.4.js"> script> <style type="text/css"> body{font-size:13px} .divFrame{border:solid 1px #666;width:168px;text-align:center;} .divFrame .divTitle{background-color:#eee;padding:5px 0px 5px 0px} .divFrame .divContent{width:108px;height:52px;padding:5px 0px 5px 0px;margin:0px 30px 0px 30px;overflow:hidden} .divFrame .divContent .divList{width:162px;position:absolute} .divFrame .divContent .divList span{border:solid 1px #ccc;background-color:#eee;width:50px;height:50px;float:left;margin-right:2px} .btn {border:#666 1px solid;padding:2px;width:60px;filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff, EndColorStr=#ECE9D8)} style> <script type="text/javascript"> $(function() { $("input:eq(0)").click(function() { //左移按钮点击事件 //在3000毫秒内,以动画的形式向左移动52个像素 $(".divList").animate({ left: "-=52px" }, 3000);
            })
            $("input:eq(1)").click(function() { //右移按钮点击事件 //在3000毫秒内,以动画的形式向右移动52个像素 $(".divList").animate({ left: "+=52px" }, 3000);
            })
        }) script> head> <body> <div class="divFrame"> <div class="divTitle"> <input id="Button1" type="button" value="左移" class="btn" />  <input id="Button2" type="button" value="右移" class="btn" /> div> <div class="divContent"> <div class="divList"> <span>1span> <span>2span> <span>3span> div> div> div> body> html> 
关注
打赏
1655516835
查看更多评论
立即登录/注册

微信扫码登录

0.2587s