* { margin:0; padding:0; } .contain { width:580px; height:370px; margin:50px auto; border:1px solid #ccc; } .contain ul li { float:left; width:180px; height:110px; list-style:none; margin:10px 0 0 10px; } .contain .item { width:180px; height:110px; background:#ccc; } .contain img { width:180px; height:110px; border-radius:5px; cursor:pointer; }
通过拖拽效果实现图片的位置切换,后面的拖拽到前面