tags:

views:

909

answers:

2

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

thanks!

A: 

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");
b0x0rz
A: 

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;
}
RichieHindle
Chris.Jie
For a complete list of all window features (the 3rd parameter) see https://developer.mozilla.org/en/DOM:window.open and http://msdn.microsoft.com/en-us/library/ms536651.aspx
Grant Wagner