How does Javascript achieve automatic sorting?

Source: Internet
Author: User
For a Metro-style UI webpage, how does one automatically sort other icons based on the position of the dragged icon after dragging the mouse? Note: The icon size may be different. The result must be retained (the layout will remain unchanged after the page is reloaded). you do not need to consider compatibility. you just need to briefly discuss the general idea...

For a Metro-style UI webpage, how does one automatically sort other icons based on the position of the dragged icon after dragging the mouse?
Note:

  1. The icon size may be different;

  2. The results must be retained (the layout remains unchanged after the page is reloaded );

  3. There is no need to consider compatibility. you only need to briefly discuss the general idea.

The effect is like the Start menu of Windows 10:

Reply content:

For a Metro-style UI webpage, how does one automatically sort other icons based on the position of the dragged icon after dragging the mouse?
Note:

  1. The icon size may be different;

  2. The results must be retained (the layout remains unchanged after the page is reloaded );

  3. There is no need to consider compatibility. you only need to briefly discuss the general idea.

The effect is like the Start menu of Windows 10:

According to the coordinates, an icon is dragged to a position. the coordinates of the icon are the coordinates of the new position. the coordinates of the affected icon are subtracted from the width or width of the dragged icon.

There should be corresponding plug-ins.

I personally think it can be understood as two locations for exchange. if you used a plug-in yesterday, you can try "sortable. js? 1.1.9 "very small, about 3 kB, and easy to use

I suggest using a plug-in if it's fast. I think it's awesome to write it myself.

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