一、使用原生js实现拖拽点击打开视频讲解更加详细
<html lang="en"> <head> <meta charset="UTF-8" /> <title>Lazyload</title> <style> .drag { background-color: skyblue; position: absolute; line-height: 100px; text-align: center; width: 100px; height: 100px; } </style> </head> <body> <!-- left和top要写在行内样式里面 --> <div class="drag" style="left: 0; top: 0">按住拖动</div> <script src=https://www.huyubaike.com/biancheng/"./jquery-3.6.0.min.js">