弹出窗口内的滚动条

时间:2017-08-27 14:30:35

标签: html css

如何在弹出窗口中添加滚动条,以便我可以在PopUp窗口中访问搜索结果?

我的弹出窗口代码:

<html>
<body>

<link rel="stylesheet" type="text/css" href="https://secure.duoservers.com/tld-search/api-search.css?color=0000ff&width=700"/>
<script type="text/javascript" src="https://secure.duoservers.com/tld-search/api-search.js?lang=en&store=7xhosting"></script>
<script type="text/javascript">
searchApiOptions = {
    store: "7xhosting",
    containerId: "divID",
    submitURL: "",
    selectedTld: "com",
    popupBox: true,
    floatingBox: false
};
</script>
<div id="divID"></div>

</body>
</html>

Image1 Image2

3 个答案:

答案 0 :(得分:2)

要强制滚动条,请在要接收的元素上将overflow-y设置为scroll,如下所示。

#divID {
   overflow-y: scroll;
}

答案 1 :(得分:0)

在css中设置一些最小高度和高度

 div#divId 
{
  min-height:300px;
  height:300px;
  overflow:scroll;
}

然后设置overflow:scroll

答案 2 :(得分:0)

.divID{
  overflow-x:hidden;
  overflow-y:auto;
  min-height:200px;
  max-height:250px;
}

而不是id给你的div class。 我已经给了overflow-y:auto所以滚动条只有在div中有溢出时才可见。

希望这有帮助。