这是代码:
<script type="text/javascript">
$(function(){
var dialogOptions = {
title: "Header",
autoOpen: false,
modal: true,
width: 400,
height: 1000
};
$(".wnd").dialog(dialogOptions);
$("#btn").click(function(){ $(".wnd").dialog("open"); });
});
</script>
<style>
.wnd {background:yellow;height:900px;width:300px;}
</style>
<div class="wnd"></div>
<button id="btn">click me</button>
Run Code Online (Sandbox Code Playgroud)
当打开对话框并且它高于主窗口时,会有一个侧滑块,如果您尝试使用鼠标光标拖动它(它看起来像锁定),它不会向下滑动.
但是当按下键盘上的按钮(箭头)或用鼠标滚轮向下滚动时,它可以滑动.
如何激活侧滑块?
谢谢!
我似乎无法理解如何正确设置jquery ui对话框的高度.
我希望它显示高度,无论多少内容存在,但如果它超过400像素,那么我想要一个滚动条.
因此,如果内容的高度为200像素,则对话框的高度应为200像素.
如果内容的高度大于400像素,则对话框不应超过400像素,并且应该可以看到滚动条.
到目前为止我有这个:
$("#popup").dialog({
modal: true,
autoOpen: false
});
Run Code Online (Sandbox Code Playgroud)