div 拖动3(2)

来源:互联网 发布:怎么宣传淘宝店铺 编辑:程序博客网 时间:2024/05/24 05:01

<!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=gb2312" />
<title>Jquery拖动插件-Jquery.anyDrag演示</title>
<script src="jquery1.4.2.min.js" type="text/javascript"></script>
<script src="jquery.anyDrag.min.js" type="text/javascript"></script>
<script  type="text/javascript">
$(function(){
 //$(".drag").anyDrag()  
 $(".drag").anyDrag({obj:".hot",maxTop:true,alpha:0.5}); 
 
 
 /**
 /* 【参数说明】
 /* obj 拖动热区,拖动所选对象的什么位置 可拖动,默认为 对象整体可拖动。 如果只要标题栏可拖动 请传入 选择器(class 或是 id)
 /* maxTop 拖动放开后 是否在最顶层,默认为false  不在最顶层。
 /* alpha 拖动时 被拖动对象的透明度,默认为1. 不透明。
  **/
 
})


</script>
<style type="text/css">
body{ font-size:12px; margin:0; padding:0;}
.drag{ width:300px; height:200px; border:1px solid #936; }
.drag .hot{width:100%; height:30px; border-bottom:1px solid #936; line-height:30px; background:#999;}
.drag .content{ height:170px;}
/*Download by http://www.codefans.net*/
.s0{background:#F60; left:100px;top:200px;}
.s1{background:#396; left:20px;top:400px;}
.s2{background:#9CF; left:300px;top:10px;}

</style>
</head>

<body>
 
 <div class="drag s0">
        <div class="hot">标题</div> 
        <div class="content">
            这是是内容0
        </div>
 </div>
 <div class="drag s1">
        <div class="hot">标题</div> 
        <div class="content">
            这是是内容1
        </div>
 </div>
 <div class="drag s2">
        <div class="hot">标题</div> 
        <div class="content">
            这是是内容2
        </div>
 </div>       

</body>
</html>