Firefox 7 does fullscreen browser window
I am unable to resize a browser window using javascript in Firefox 7. This code works in all the browser so far I 开发者_开发技巧have checked. Does anyone know why it is not working in firefox 7.
In my example I am trying to resize a window which is opened as a result of clicking a link in a parent window. Thus, I have 2 files here.
index.html (parent)
Head section<script type="text/javascript">
function openwin() {
var win1 = window.open('index2.html','mywin','left=20,top=20,width=900,height=700,toolbar=1,resizable=0');
}
</script>
Body section -
<a href="javascript:openwin()">Click to open a new window</a>
index2.html (child)
Head section<script type="text/javascript">
function fullscreen() {
window.moveTo(0,0)
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
Body section -
<a href="javascript:fullscreen()">Click to fullscreen a window</a>
Please let me know if any help. I assume there is a bug with FF7. Many thanks
This is currently a bug in Firefox 7. It have been already reported to mozilla. More info available in the Bug report
In FF6 you should use window.innerWidth
or window.outerWidth
and window.innerHeight
or window.outerHeight
to set window size, as shown here:
http://www.java2s.com/Code/JavaScript/Window-Browser/SettingWindowHeightandWidthFirefox.htm
精彩评论