| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | Is this possible in JavaScript? Does anyone know how to set the current window to fullscreen with JavaScript? I want the current window to be fullscreen WITHOUT opening a new window...
__________________ Yeah... I knew that. What? |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | Fullscreen mode is optional so there is no forcing involved. Anyway, I figured out how to do it myself.var screensettings = "small" function screenchange() { if (screensettings == "small") { if (document.layers) { if (top.window.innerWidth == screen.width) { alert("Window cannot be maximized when entering fullscreen mode."); } else { screensettings = "big"; fullscreen() } } else { if (top.document.body.offsetWidth == screen.width) { alert("Window cannot be maximized when entering fullscreen mode."); } else { screensettings = "big"; fullscreen() } } } else { screensettings = "small"; restore() } } function fullscreen() { if (document.layers) { top.window.resizeTo(screen.width+20,screen.height+ 300); top.window.moveTo(-10,-100); } else { top.window.resizeTo(screen.width+20,screen.height+ 300); top.window.moveTo(-10,-100); } } function restore() { if (document.layers) ????: NamePros.com http://www.namepros.com/programming/15098-is-this-possible-in-javascript.html { top.window.resizeTo(200,200); top.window.moveTo(0,0); } else { top.window.resizeTo(200,200); top.window.moveTo(0,0); } }
__________________ Yeah... I knew that. What? |
| |