如果弹出窗口中的内容超出预期,希望有垂直滚动条
如果 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有获得滚动条的原因是您在窗口选项中指定了
scrollbars=no
。删除打开代码中的指令,或将其替换为
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.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 forwindow.open
.See a demo at http://nikc.kapsi.fi/dev/html/misc/openpopup.html
,scrollbars=no
必须是,scrollbars=yes
在此处测试:http://jsfiddle.net/yFRf2/
,scrollbars=no
must be,scrollbars=yes
test it here: http://jsfiddle.net/yFRf2/