Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javascript

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

thanks!

like image 997
Chris.Jie Avatar asked Jul 22 '09 05:07

Chris.Jie


People also ask

How do I return a value from a Windows Open?

Typically the onclick event on the "Yes" or "Ok" button in the modal dialog looks like this: window. returnValue = true; window. close();

How do I force scrollbar?

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.

How do I enable scrollbar in HTML?

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.


2 Answers

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; } 
like image 142
RichieHindle Avatar answered Sep 25 '22 19:09

RichieHindle


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");  
like image 39
b0x0rz Avatar answered Sep 24 '22 19:09

b0x0rz