最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery UI Draggable + Sortable 結(jié)合使用(實(shí)例講解)

 更新時(shí)間:2017年09月07日 07:56:19   作者:lance2008  
下面小編就為大家?guī)硪黄猨Query UI Draggable + Sortable 結(jié)合使用(實(shí)例講解)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

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

Demo截圖:從左邊控件拖到右邊區(qū)域

代碼段:

<script type="text/javascript">
  $(function () {
    $("#box_wrap1,#box_wrap2").sortable({
      connectWith: ".box_wrap",
      helper: "clone",
      cursor: "move",//移動(dòng)時(shí)候鼠標(biāo)樣式
      opacity: 0.5, //拖拽過程中透明度
      placeholder: "box-holdplace",//占位符className,設(shè)置一個(gè)樣式
    }).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 結(jié)合使用(實(shí)例講解)就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

修文县| 进贤县| 延庆县| 清新县| 湖口县| 九寨沟县| 丹寨县| 临清市| 营山县| 榆树市| 桂阳县| 琼结县| 辽宁省| 福州市| 开平市| 南乐县| 西丰县| 游戏| 阿拉尔市| 南岸区| 青川县| 上饶县| 高平市| 鄂托克旗| 东乌珠穆沁旗| 区。| 洛阳市| 肃南| 城市| 施甸县| 太和县| 阿克苏市| 高唐县| 琼中| 乳山市| 天祝| 北宁市| 潜江市| 五家渠市| 肇东市| 乳源|