开发者

jquery grab and move toggle element

开发者 https://www.devze.com 2022-12-27 10:43 出处:网络
i have a div that is displayed via: $(\'a#biz-blue-lnk\').click(function() { $(\'#business-blue\').show();

i have a div that is displayed via:

$('a#biz-blue-lnk').click(function() {
    $('#business-blue').show();
    return false;
  });

what i want to figure out is when this DIV is displayed, can i enable the user to grab it and move it around the scre开发者_如何学JAVAen? potentially if they click another DIV they could have two elements on screen... and would like them to be able to move them around to see each one...

possible?


Look into jQueryUI & the draggable() functionality.


Check out the Draggable, part of jQuery UI. It's as simple as $('#business-blue').draggable(); then!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号