JQuery UI-draggable parameter introduction (2)

Source: Internet
Author: User

Snap-):

JQuery ("# draggable1"). draggable ({snap: true });//Default, adsorption in any way
JQuery ("# draggable2"). draggable ({snap: "# snaptarget "});//Adsorption with the inner and outer diameter of an element
JQuery ("# draggable3"). draggable ({snap: "# snaptarget", snapMode: "outer "});//Adsorption with the outer diameter of an element. The adsorption method is as follows: local upper absorption, local lower absorption
JQuery ("# draggable4"). draggable ({grid: [20, 20]}); //Move at a certain distance
JQuery ("# draggable5"). draggable ({grid: [80, 80]});

Source code-html code:

<Html> 

PS: For jQuery ("# draggable3 "). draggable ({snap: "# snaptarget", snapMode: "outer"}); // adsorption with the outer diameter of an element. Adsorption Method: upper part of the element, what I understand in this article: id
It is the outer diameter adsorption of the container whose id is "snaptarget" for draggable3. That is, draggable3 is on snaptarget.
The bottom border of draggable3 and the top border of snaptarget are adsorbed. When draggable3 is under snaptarget
The bottom border of the box and snaptarget is adsorbed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.