jquery实现图片拖拉拖拽排序分类效果代码
代码语言:html
所属分类:拖放
代码描述:jquery实现图片拖拉拖拽排序分类效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style type="text/css"> .item_content ul{list-style:none;} .item_content ul li{width:200px;height:160px;float:left;margin:10px } .item_content{width:740px;height:auto; float:left;} .item_content .item{width:200px;height:120px;line-height:120px;text-align:center;cursor:pointer;background:#ccc;} .item_content .item img{width:200px;height:120px;border-radius:6px;} .close{display:block;width:20px;height:20px;top:0;right:0;z-index:9999;position:absolute;text-align:center;font-size:16px;cursor:pointer;color:aliceblue;} </style> </head> <body> <div class="item_container"> <div class="item_content" id="imageChange"> <ul> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/5e323253cf4d2.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/5e5314d9c6386.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/5e62ef41353c3.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/5e957a2236f31.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/5fc1a9b3bd22e.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/600d657ecf5ce.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/6032e4426c6dd.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/603858d4a427a.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> <li> <div class="item"> <img src="//repo.bfw.wiki/bfwrepo/image/60ece322d6263.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" width="150" height="150"> <span class="rmPicture close">×</span> </div> </li> </ul> </div> </div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script> <script> $(function() { function Pointer(x, y) { this.x = x ; this.y = y ; } function Position(left, top) { this.left = left ; this.top = top ; } $(".item_container .item").each(function(i) { //$(".item_content .item").each(function(i) { this.init = function() { // 初始化 this.box = $(this).parent() ; $(this).attr.........完整代码请登录后点击上方下载按钮下载查看
网友评论0