programming.name Posted December 13, 2012 Share Posted December 13, 2012 Hi, Is that possible to implement an effect that F11 key is pressed automatically on load? I mean I'm trying to maximize the window and I don't want to actually resize the window with the window object. I rather to use the keycode to get the same effect as if I press the F11 key manually to "REALLY" maximize the window. (with auto-hide-and-show address bar) I want to return the value of keycode on load and I found that most browsers'(at least my target browsers) value for F11 is 122. So I tried the following: test.html <body onload="return max_win(event)"> test.js function get_keycode(e) { if (window.event) { keycode=event.keyCode; } else { keycode= e.which; } } function max_win(e) { get_keycode(e); return keycode=122; } It does nothing. can anyone fix my problem please? Thanks inadvance. Quote Link to comment Share on other sites More sharing options...
.josh Posted December 13, 2012 Share Posted December 13, 2012 javascript cannot do this. Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 13, 2012 Share Posted December 13, 2012 ## I apologize in advance for the following rant. ## Even if it could I would avoid your site like the plague. My own company does that with several of our web applications and it annoys the hell out of me. It's my freakin' browser, if I want it maximized I'll do it myself. It strikes me as pure arrogance that a site feels that their application is so important that it should be viewed full screen for me. WTF? I have very large monitors - depending on what system I'm using - and if the site is built to work with moderately sized monitors (as it should) then making it full screen for me is going to mostly display empty space. It would be like having a TV that uses PIP (Picture In Picture) and when a commercial comes on it detects that it is running in a small window and decides for me that it is more important and should take up the full screen. Leave my freakin' browser window alone. Quote Link to comment Share on other sites More sharing options...
codefossa Posted December 13, 2012 Share Posted December 13, 2012 lol .. what Psycho said pretty much. I mean, it's possible to rig up a way to make it about the same, but it would just be annoying as hell, and my screen is big enough that most sites are quite small anyways. You can give a message to fullscreen it by pressing F11, but forcing it is a dick move. I don't even use my browser maximized because of all the empty space. I have room for other applications beside it, and I don't want the browser to cover them up on its own. If I did, I would do it myself. If you really must for some reason which I don't think exists .. You could open a window with no toolbars and whatnot, set the location of the browser to hide the top and then fill the rest of the screen. You would have to guess on the height of the window bar, and here in Linux, it won't let you set it that high so you would be putting some window below the screen. You would be better off just allowing the title bar to be there and making the window the size of the screen, but again .. this would still drive me nuts and I wouldn't bother to use your site. If I really had to use the site, I would make a plugin to change it or open the URL in a new tab myself and bookmark it. Otherwise .. you shouldn't do it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.