Some advanced Javascript drag-and-drop applications (analyzing code line by line, making it easy to drag the principle) _ javascript tips-js tutorial

Source: Internet
Author: User
This article mainly introduces some advanced Javascript drag-and-drop applications (analyzing code line by line, making it easy to drag the principle ), if you need something, refer to the following to see what will happen when the previous drag and drop is around? There won't be any problems in the advanced browser. Let's test it under IE7 and the problem will come out.

We can clearly see that all texts have been selected. The user experience is poor and it is not convenient to use. By the way, we previously added a return false; which helped us solve many problems. If we removed this, chrome would have the same problem. That is to say, this return false; can solve the problem of chrome ff IE9 + these browsers.

In fact, in our development, there are many elements on the page, and it is impossible to make a p. When you drag it, it will not be selected elsewhere. For example, Baidu map, you can play with it.
How can we achieve this drag? What about IE7?

Solution:

We can use a small trick to solve, this trick is only supported in the IE6-8, actually can solve our problem, because other browsers with return false; that's enough. Let's take a look at the tips.

Event capture !! The code is attached to a brief description.

    
Related Article

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.