How does JavaScript implement automatic sequencing?

Source: Internet
Author: User

A Metro-style UI page, how to implement the mouse to drag an icon after the other icons based on the location of the dragged icon automatically sorted?
Attention:

    1. The icon size may be different;

    2. Requires the result to be retained (the layout is not changed after overloading the page);

    3. No need to consider compatibility, just a brief talk about the idea.

The effect is like the Windows10 Start menu:

Reply content:

A Metro-style UI page, how to implement the mouse to drag an icon after the other icons based on the location of the dragged icon automatically sorted?
Attention:

    1. The icon size may be different;

    2. Requires the result to be retained (the layout is not changed after overloading the page);

    3. No need to consider compatibility, just a brief talk about the idea.

The effect is like the Windows10 Start menu:

This is based on the coordinates, an icon is dragged to a position, the coordinates of the icon is the coordinates of the new position, the coordinates of the affected icon minus the width or width of the drag icon

There should be a corresponding plug-in bar

Personally feel can be understood as two locations to exchange, yesterday with a plug-in you can try "sortable.js" very small 3kb or so, and very useful

Quick words suggested with plug-in, write yourself that I feel pretty bull

Official have implementation and documentation
metroui:http://metroui.org.ua/
Start-screen:http://metroui.org.ua/templat ...

  • 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.