gpt4 book ai didi

jquery UI 对话框滚动跟随?

转载 作者:行者123 更新时间:2023-12-01 01:17:32 27 4
gpt4 key购买 nike

jquery UI 对话框如何能够跟随窗口滚动?

最佳答案

这是可能的,但您需要覆盖基本的 jQueryUI 样式,因此请确保(在您的 CSS 中)您具有:

.ui-dialog {
position: fixed !important;
}

这是一个例子:

$(function() {
$("#dialog-modal").dialog({
height: 140,
modal: true
});
});
body {
height: 3000px;
}

p {
margin-bottom: 300px;
}

.ui-dialog {
position: fixed !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


<div id="dialog-modal" title="Basic modal dialog">
<p>Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.</p>
</div>


<!--these are here to help show that the dialogue is actually fixed -->
<p>A</p>
<p>B</p>
<p>C</p>
<p>D</p>
<p>E</p>
<p>F</p>

关于jquery UI 对话框滚动跟随?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10864059/

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