gpt4 book ai didi

javascript - jQuery UI 可拖动中的错误

转载 作者:行者123 更新时间:2023-12-02 20:01:36 25 4
gpt4 key购买 nike

我不知道如何解决这个问题,但看看这个: enter image description here

当我向右或向下拉动时,就会出现滚动条。这是代码:

$(this).draggable({
stack: ".window",
containment: "document",
scroll: false,
...

HTML 代码:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Inteli Mirgo windows</title>
<link rel="stylesheet" type="text/css" href="styles/default/style.css" media="all" />
<link rel="stylesheet" type="text/css" href="styles/default/mirgo.css" media="all" />
<link rel="stylesheet" href="styles/default/jquery.ui.all.css">
<script src="scripts/jquery-1.6.2.js"></script>
<script src="scripts/jquery.ui.core.js"></script>
<script src="scripts/jquery.ui.widget.js"></script>
<script src="scripts/jquery.ui.mouse.js"></script>
<script src="scripts/jquery.ui.draggable.js"></script>
<script src="scripts/jquery.ui.resizable.js"></script>
<script src="scripts/jquery.ui.droppable.js"></script>
<script src="scripts/default/mirgo.js"></script>
</head>
<body>
<div class="window optionResizable" style="width: 300px; height: 200px; left: 150px; top: 160px;">
<div class="titleWindow">
Window #1
</div>
<div class="bodyWindow">
Content of window #1
</div>
</div>
<div class="window optionResizable" style="width: 200px; height: 100px; left: 300px; top: 140px;">
<div class="titleWindow">
Window #2
</div>
<div class="bodyWindow">
Content of window #2
</div>
</div>
<div class="window optionResizable" style="width: 500px; height: 500px; left: 600px; top: 20px;">
<div class="titleWindow">
Window #3
</div>
<div class="bodyWindow">
Content of window #3
</div>
</div>
</body>
</html>

CSS:

* {
margin: 0;
padding: 0;
}
body {
background: url('images/bg.png');
font-family: sans-serif;
font-size: 13px;
}
.window {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #fff;
position: absolute !important;
border: 1px solid #CFCFCF;
-webkit-box-shadow: 1px 1px 5px 0px #BBBBBB;
-moz-box-shadow: 1px 1px 5px 0px #BBBBBB;
box-shadow: 1px 1px 5px 0px #BBBBBB;
}
...

我不知道为什么会这样,我该如何解决这个问题?

附注我尝试使用 containment: "body"但在 Firefox 中它不起作用。

我添加了新的 div <div id="wow">test</div>这是没有任何 css 的标准 div 并将 JS 更改为: $('#wow').draggable({stack: "#wow",containment: "document",scroll: false});并且效果一样!再次滚动条:(

最佳答案

这不是 jQuery UI 的问题,而是 CSS 的问题

试试这个:

body{
overflow: hidden;
}

关于javascript - jQuery UI 可拖动中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7905770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com