日期:2014-05-16  浏览次数:20636 次

mootools : Drag is not defined
测试mootools的drag功能,照官网写了简单demo,但是页面报错:
Uncaught ReferenceError: Drag is not defined 
貌似没有找到Dag类的定义;mootools为1.4,在当前目录下;mootools引入没有问题,用以下方法测试通过:

window.addEvent('domready', function(){
$('dragMe').addEvent('click',function(){
alert("just clicked");
});
 
});


请各位看看是什么原因,谢谢!页面代码:

<html>
  <head>
    <script  type="text/javascript" src="mootools.js"></script>
    <script type="text/javascript">
        window.addEvent('domready', function(){
          new Drag.Move($('dragMe'), {
              container: $('container'),
              droppables: $$('.drop'),
              onEnter: function(element, droppable){
                droppable.setStyle('background', '#E79D35');
              }
          });
        });
    </script>

      <style type="text/css">
#container {
  background: #DDD;
  height: 260px;
  position: relative;
}
 
#dragMe {
  background: #78BA91;
  cursor: move;
  height: 40px;
  left: 0;
  position: absolute;
  top: 0;
  width: 40px;
}
.drop {
  background: #6B7B95;
  float: left;
  height: 60px;
  margin-left: 20px;
  margin-top: 20px;
  width: 72px;
}
</style>
  </head>
  <body>
      <div id="container">
        <div id="dragMe">drag Me</div>
        <div class="drop"></div>
        <div class="drop"></div>
        <div class="drop"></div>
      </div>

  <body>

</html>
mootools Drag.Move

------解决方案--------------------
<html>
  <head>
  <meta charset="gbk" />
<script src="http://mootools.net/demos/Source/mootools-core-1.4-full.js"></script>
<script src="http://mootools.net/demos/Source/mootools-more-1.4-full.js"></script>
    <script type="text/javascript">
        window.addEvent('domready', function(){