注意js放的位置,要放的靠近,若被其他覆盖,则无法移动。
比如:
可移动的DIV
引入jquery.js, jquery-ui.js,
一句:
$("#move").draggable();
如希望,点住时鼠标变手形:
$("#move").mousedown(function(){ $(this).css("cursor","pointer"); }).mouseup(function(){ $(this).css("cursor","default"); });
下面给大家分享一段通用代码jquery实现拖动div的通用方法
Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1
| 本站CDN由 数掘科技 提供