Login | Register | FAQ
Anonymous

Button using JS with functionality of F11 keyboard key

+ Post a reply

4 posts Page 1 of 1


Button using JS with functionality of F11 keyboard key

by cryoffalcon » Thu Apr 26, 2012 11:33 am

Hi,
I want to make a button which if pressed works as if F11 key on keyboard is pressed.
For button html would be like this (I think)

<button type="button" onclick="some function">FullScreen</button>

Now I don't know what function would go in that onclick as I don't have the JS. One more thing that would be nice if the text 'FULLSCREEN' changes to 'NORMAL WINDOW' when the button is pressed, so that the user could realize that they have to press the same button again to get out of fullscreen, it would be like toggle at every click text changes from 'FULLSCREEN' to 'NORMAL WINDOW' and then if pressed again changing to 'FULLSCREEN'.
User avatar

cryoffalcon

  • Posts: 8
  • Joined: Thu Apr 19, 2012 8:08 am

Re: Button using JS with functionality of F11 keyboard key

by XainPro » Thu Apr 26, 2012 1:12 pm

User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Button using JS with functionality of F11 keyboard key

by cryoffalcon » Fri Apr 27, 2012 5:45 am

Thanks for your reply, I guess due to security they are maybe not allowing it as you said, I looked everywhere and didn't find anything.
I like your first method it is almost what I want but it doesn't work in IE8 (haven't tested any other IE versions) in IE it says it got some json error.
User avatar

cryoffalcon

  • Posts: 8
  • Joined: Thu Apr 19, 2012 8:08 am

Re: Button using JS with functionality of F11 keyboard key

by XainPro » Fri Apr 27, 2012 9:57 pm

yah its because of security reasons its not allowed to do things like that in 1999 that was allowed but after that they exclude it.
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1