JQuery实现拖拽draggable()方法

 <script language="javascript" src="jquery.ui/jquery-1.2.4a.js" ></script>
<script language="javascript" src="jquery.ui/ui.base.min.js"></script>
   <script language="javascript" src="jquery.ui/ui.draggable.min.js" ></script>//注:引用的三个插件顺序不能变
<script language="javascript">
    $(function() {
        //直接调用拖拽方法
        $("div").draggable();
    });
</script>


</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div style="background-color:Purple; width:200px; height:200px;">I am one</div>
    <div style="background-color:Maroon; width:200px; height:200px;">I am two</div>
    <div style="background-color:Gray; width:200px; height:200px;">I am three</div>
    </div>
    </form>
</body>

posted on 2011-03-24 12:59  MyBeN  阅读(4302)  评论(0编辑  收藏  举报

导航