免费观看又色又爽又黄的小说免费_美女福利视频国产片_亚洲欧美精品_美国一级大黄大色毛片

jQueryUIDraggable+Sortable結合使用(實例講解)

工作中需要將一個左邊的設計好的控件,拖拽到右邊的面板中,同時保持右邊面板中的控件自由排序,這時候就需要及支持拖拽又支持排序的操作了,

成都創新互聯公司長期為千余家客戶提供的網站建設服務,團隊從業經驗10年,關注不同地域、不同群體,并針對不同對象提供差異化的產品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯網生態環境。為陳倉企業提供專業的成都做網站、網站制作,陳倉網站改版等技術服務。擁有十年豐富建站經驗和眾多成功案例,為您定制開發。

Demo截圖:從左邊控件拖到右邊區域

jQuery UI Draggable + Sortable 結合使用(實例講解)

代碼段:

<script type="text/javascript">
  $(function () {
    $("#box_wrap1,#box_wrap2").sortable({
      connectWith: ".box_wrap",
      helper: "clone",
      cursor: "move",//移動時候鼠標樣式
      opacity: 0.5, //拖拽過程中透明度
      placeholder: "box-holdplace",//占位符className,設置一個樣式
    }).disableSelection();
 
    $(".dragable").draggable({
      connectToSortable: ".sortable",
      helper: "clone",
      // revert: "invalid",
      // handle: ".handle"
    });
  });
</script>

Html 代碼:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title></title>
  <link href="js/bootstrap/css/bootstrap.css" rel="external nofollow" rel="stylesheet" />
  <link href="js/bootstrap/css/bootstrap-theme.min.css" rel="external nofollow" rel="stylesheet" />
  <link href="css/index.css" rel="external nofollow" rel="stylesheet" />
 
  <script src="js/jquery-1.10.2.min.js"></script>
  <script src="js/bootstrap/js/bootstrap.min.js"></script>
 
  <!--Sortable -->
  <script src="http://apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
 
</head>
<body>
  <div class="container">
    <div class="row">
      <div class="column col-md-6">
        <div class="box_wrap " id="box_wrap1" >
          <div class="box dragable">
            left-test1
          </div>
          <div class="box dragable">
            left-test2
          </div>
          <div class="box dragable">
            left-test3
          </div>
        </div>
      </div>
      <div class="column col-md-6">
        <div class="box_wrap sortable" id="box_wrap2">
          <div class="box">
            test1
          </div>
          <div class="box">
            test2
          </div>
          <div class="box">
            test3
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

以上這篇jQuery UI Draggable + Sortable 結合使用(實例講解)就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持創新互聯。

當前名稱:jQueryUIDraggable+Sortable結合使用(實例講解)
網站路徑:http://m.newbst.com/article0/jeseio.html

成都網站建設公司_創新互聯,為您提供品牌網站制作小程序開發移動網站建設商城網站定制開發App設計

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

h5響應式網站建設