论坛首页 入门技术论坛

javascript

浏览 1462 次
锁定老帖子 主题:javascript
该帖已经被评为新手帖
作者 正文
   发表时间:2007-09-23  
gfdsgfdsg

<html>
<head>
 <title>个性化主页</title>
 <link type="text/css" rel="stylesheet" href="css/default.css" />

 <script type="text/javascript" src="js/prototype.js"></script>

 <script type="text/javascript" src="js/scriptaculous.js?load=effects,dragdrop"></script>

</head>
<body>
 <div id="main">
  <div id="leftContainer">
   <div class="module" style="height: 200px">
   </div>
  </div>
  <div id="midContainer">
   <div class="module" style="height: 200px">
   </div>
   <div class="module" style="height: 200px">
   </div>
  </div>
  <div id="rightContainer">
   <div class="module" style="height: 200px">
   </div>
   <div class="module" style="height: 200px">
   </div>
   <div class="module" style="height: 200px">
   </div>
  </div>
 </div>

 <script type="text/javascript">
  function enableDnd() {
   var containers = ["leftContainer", "midContainer", "rightContainer"];
   
   var kw = {
    tag: "div",
    treeTag: "div",
    handle: "title",
    dropOnEmpty: true,
    containment: containers,
    constraint: false,
    ghosting:true,
    onUpdate:function(){
       //$('thirdlist_debug').style
       var object=event.srcElement;
       object.style.zInde=1;
       object.style.border="1px dashed red";
      
    }
   }; 

   containers.each( function(module) {
    Sortable.destroy(module);
    Sortable.create(module, kw);
   });
  }
  
  enableDnd();
  
  function getInfo(o){//取得坐标
           var to=new Object();
           to.left=to.right=to.top=to.bottom=0;
           var twidth=o.offsetWidth;
           var theight=o.offsetHeight;
           while(o!=document.body){
           to.left+=o.offsetLeft;
           to.top+=o.offsetTop;
           o=o.offsetParent;
           }
           to.right=to.left+twidth;
           to.bottom=to.top+theight;
           return to;
         }
        
 function  dragEnd(){
 tdiv.mm=Drag.repos(150,15);
 object.style.borderWidth="0px";
 object.style.borderTop="1px solid #3366cc";
 tdiv.style.borderWidth="0px";
 objcet.style.zIndex=1;
}

 </script>

</body>
</html>

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics