Home > Web Front-end > JS Tutorial > body text

基于jquery的一行代码轻松实现拖动效果_jquery

WBOY
Release: 2016-05-16 18:13:13
Original
999 people have browsed it

实现拖动效果.

复制代码 代码如下:

$(document).ready( function()
{
$("#divPanel").easydrag();
}
);


Html 代码
复制代码 代码如下:



Title






EasyDrag还可以指定可拖动的区域,比如只能通过标题拖动整个div,我们JS可以这样写
复制代码 代码如下:

$(document).ready ( function()
{
$("#divPanel").easydrag();

$("#divPanel").setHandler("divTitle");
}
);

一个setHandler搞定,不错开源是个好东西,Jquery更是好东西,插件扩展机制不是一般的好。
Drag.rar打包
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template