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.