javascript - Enabling browser scroll bars after window.open with scrollbars=no -


i have existing link opens webpage in new window scrollbars disabled follows:

<a onclick='window.open("example.html", "name", "resizable=1,scrollbars=no,width=500,height=200");' href='#'>click pop without scroll bars</a> 

for sake of argument, cannot change window.open() code. need enable scroll bars after window has been opened.

this works in ie using following code:

 <script type="text/javascript">     onload=function()         {     enablescrolling();     }     function enablescrolling()     {       document.body.scroll = "yes"; // ie      }  </script>  

however not work in firefox or chrome.

according page, following code should work firefox , chrome not (perhaps worked in earlier versions?)

      document.documentelement.style.overflow='scroll';       document.body.style.overflow='scroll'; 

does know if possible enable scroll bars in firefox , chrome after window has been opened scrollbars disabled?

just nikunj soni said, setting height attribute body tag solve problem in every browser. differently following:

instead of setting fixed height, set height:100%, enable open popup in different sizes original.

<body style="overflow:auto; height:100%;">         rest of html code    </body> 

this not best solution, removing restictions link.

hope find answer helpful.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -