draggable拖动事件

来源:互联网 发布:手机怎么申请淘宝开店 编辑:程序博客网 时间:2024/05/21 17:00
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI 拖动(Draggable) - 默认功能</title>
  <link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
  <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
  <link rel="stylesheet" href="jqueryui/style.css">
  <style>
  #draggable { width: 150px; height: 150px; padding: 0.5em; }
  </style>
  <script>
  $(function() {

    $( "#draggable" ).draggable({ axis: "y" });

 $( "#draggable" ).draggable({ axis: "x" });

  });
  </script>
</head>
<body>
 
<div id="draggable" class="ui-widget-content">
  <p>请拖动我!</p>
</div>
 <div id="draggable1" class="ui-widget-content">
  <p>请拖动我!</p>
</div>
 
</body>
</html>
0 0
原创粉丝点击