如果弹出窗口中的内容超出预期,希望有垂直滚动条

发布于 2024-09-03 03:34:51 字数 299 浏览 7 评论 0原文

如果 popwindow 中的内容超出预期,想要有垂直滚动条...

我有一个片段可以在单击按钮时显示 popwindow,如下所示: window.open(url,'popupWindow','工具栏=否,位置=否,目录=否,状态=否,菜单栏=否,滚动条=否,可调整大小=是,复制历史记录=否,宽度= 650,高度= 500 ,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden')

有了这个,如果我有超过预期的内容,我就无法拥有垂直滚动条,我该怎么办在需要时让垂直滚动条自行显示?

Want to have vertical scroll bar if content is more than expected in popwindow...

I have a snippet to display the popwindow on click of a button which is given below:
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden')

with this, i am not able to have th vertical scrollbar if i have the more than expected content in it, How can i get the vertical scroll bar display byitself whenever needed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜味超标? 2024-09-10 03:34:51

您没有获得滚动条的原因是您在窗口选项中指定了 scrollbars=no

window.open(url,
'popupWindow',
'toolbar=no,location=no,directories=no,status=no,menubar=no,**scrollbars=no**,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden'
);

删除打开代码中的指令,或将其替换为 scrollbars=yes ,它应该按照您想要的方式工作。有关更多信息,请阅读window.open的文档

请参阅 http://nikc.kapsi.fi/dev/html/ 的演示杂项/openpopup.html

The reason you're not getting a scrollbar, is because you're specifying scrollbars=no in the window options.

window.open(url,
'popupWindow',
'toolbar=no,location=no,directories=no,status=no,menubar=no,**scrollbars=no**,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden'
);

Remove the instruction in the opening code, or replace it with scrollbars=yes and it should work as you want it to. For further info, read docs for window.open.

See a demo at http://nikc.kapsi.fi/dev/html/misc/openpopup.html

海夕 2024-09-10 03:34:51

,scrollbars=no 必须是 ,scrollbars=yes

在此处测试:http://jsfiddle.net/yFRf2/

,scrollbars=no must be ,scrollbars=yes

test it here: http://jsfiddle.net/yFRf2/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文