In the past, the simplest code for dragging objects was seen on the Internet. I forgot what the author called.
The original code has some minor issues in IE. After the file type is declared to be xhtml 1.0, it is invalid in non-IE browsers such as FF. It has been improved and is now compatible: IE, Firefox, Opera...
The following code demonstrates the principle. Modify the specific application based on your actual needs.
<! Doctype html public "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml" lang = "gb2312"> <pead> <title> code example: drag the Drag Object (compatible with IE, Firefox, and Opera ...) </title> <meta http-equiv = "content-type" content = "text/html; charset = gb2312 "/> <meta name =" editor "content =" fengyan, http://www.cnlei.com "> <meta name =" keywords "content =" code instance: drag object "> <meta name =" description "content =" Brief drag object code example "> <style>. dragAble {position: relative; cursor: move ;}</style> </pead> <body> these are all drag objects </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]