How to use 'window.open' to create with scrollbar in firefox?

后端 未结 2 1170
醉话见心
醉话见心 2020-12-14 14:43

How do I use \'window.open\' to create a new window with scrollbars in firefox?

thanks!

相关标签:
2条回答
  • 2020-12-14 15:16

    This should do it:

    window.open("http://example.com", "name", "scrollbars=1,width=100,height=100");
    

    but note that Firefox will only show scrollbars when the content is larger than the window.

    To force Firefox to always show a scrollbar (like Internet Explorer does) you need this in the stylesheet of the HTML that's being shown in the popup:

    html {
        overflow: -moz-scrollbars-vertical;
    }
    
    0 讨论(0)
  • 2020-12-14 15:18

    via http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

    example

    The following code opens a window with menu bar. The window is resizable and is having 350 >pixels width and 250 pixels height.

    window.open ("http://www.javascript-coder.com",
    "mywindow","menubar=1,resizable=1,width=350,height=250"); 
    

    another example

    A window with location bar, status bar, scroll bar and of size 100 X 100

    window.open ("http://www.javascript-coder.com",
    "mywindow","location=1,status=1,scrollbars=1,
    width=100,height=100"); 
    
    0 讨论(0)
提交回复
热议问题