jquery-ui draggable拖动div超出window的时候,导致滚动条滚动,怎么阻止滚动条滚动

新手上路,请多包涵

`<!DOCTYPE html>
<html lang="zh">

<head>

<meta charset="UTF-8">
<title>矩阵变换</title>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    #aaa {
        width: 800px;
        height: 800px;
        position: absolute;
        background: red;
    }

    .wrap {
        height: 2000px;
        position: relative;
        ;
    }
</style>

</head>

<body>

<div class="wrap">
    <div id='aaa'></div>
</div>
<link href="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.js"></script>
<script>
    $('#aaa').draggable();
    $(window).on('mousemove', function (e) {
        return false;
    })
</script>

</body>

</html>`

阅读 1.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题