div滑动效果

<!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>
<meta http-equiv="content-Type" content="text/html; charset=UTF-8" />
    <title>移动位置的动画</title>
    <script type="text/javascript"
            src="Jscript/jquery-1.4.2-vsdoc.js">
    </script>
    <script type="text/javascript"
            src="jquery-1.7.2.min.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:600px;position:absolute}
           .divFrame .divContent .divList span{border:solid 1px #ccc;background-color:#eee;width:100px;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() {
            $("#Button1").click(function() { //左移按钮点击事件
                //在3000毫秒内,以动画的形式向左移动52个像素
                $(".divList").animate({ left: "-=100px" }, 1000);
            })
            $("#Button2").click(function() { //右移按钮点击事件
                //在3000毫秒内,以动画的形式向右移动52个像素
                $(".divList").animate({ left: "+=100px" }, 1000);
            })
        })
    </script>
</head>
<body>
    <div class="divFrame">
         <div class="divTitle">
              <input id="Button1" type="button" value="左移" class="btn" />&nbsp;
              <input id="Button2" type="button" value="右移" class="btn" />
         </div>
         <div class="divContent">
              <div class="divList">
                   <span>菜单管理</span>
                   <span>日志管理</span>
                   <span>课件管理</span>
                   <span>密码修改</span>
                   <span>系统管理</span>

              </div>
         </div>
    </div>
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值