How do I use 'window.open' to create a new window with scrollbars in firefox?
thanks!
Typically the onclick event on the "Yes" or "Ok" button in the modal dialog looks like this: window. returnValue = true; window. close();
To show the scrollbars always on the webpage, use overflow: scroll Property. It will add both horizontal and vertical scrollbars to the webpage. To add only horizontal scrollbar use overflow-x: scroll property and for vertical scrollbar use overflow-y: scroll property.
Suppose we want to add a scroll bar option in HTML, use an “overflow” option and set it as auto-enabled for adding both horizontal and vertical scroll bars. If we want to add a vertical bar option in Html, add the line “overflow-y” in the files.
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; }
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With