sortable图片拖拽插件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script language="javascript" src="jquery-1.7.min.js"></script>
    <script language="javascript" src="jquery.sortable.js"></script>
    <script>
        $(document).ready(function(){
            getlivesortable();
        });

        function getlivesortable(){
        if ($('.imageDragSortView').html())
        $('.imageDragSortView').sortable();
      }
    </script>
  </head>
<body>

     <div id="img_div">
      <ul class="imageDragSortView">
        <li  draggable="true">
          <a href="#" target='_blank'>
            <img src="http://zqebay.com/uploads/2016/201606/20160606/wish-source-img/1465182264792-P-6795.png" width="100" height="100" border="0" />
          </a>
        </li>
        <li  draggable="true">
          <a href="#" target='_blank'>
            <img src="http://zqebay.com/uploads/2016/201606/20160606/wish-source-img/1465182246602-P-6795.jpg" width="100" height="100" border="0" />
          </a>
        </li>
        <li   draggable="true">
          <a href="#" target='_blank'>
            <img src="http://zqebay.com/uploads/2016/201606/20160606/wish-source-img/1465182246893-P-6795.jpg" width="100" height="100" border="0" />
          </a>
        </li>
      </ul>
    </div> 


</body>
</html>

对图片的拖拽、排序有很方便的功能。 具体文件可以去csdn我的资源库里下载

使用过程中出现过的问题
1.拖拽效果不理想,第一张图片不能被拖拽。 原因(getlivesortable();这个方法被调用2次或者2次以上,只需要调用一次即可)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值