I’m using jQuery fullscreen plugin https://github.com/martinaglv/jQuery-FullScreen
My code:
$('#cancel-fullscreen').hide()
//View Fullscreen
$('#view-fullscreen').click(function(){
$('#container').css({'background': 'green'}).fullScreen();
$(this).hide();
$('#cancel-fullscreen').show();
return false;
});
//Cancel Fullscreen
$('#cancel-fullscreen').click(function(){
//I need this work when "Esc" or "F11" buttons pressed
$('#container').css({'background': 'red'}).fullScreen(); //If press "Esc" background still green..
$(this).hide();
$('#view-fullscreen').show();
return false;
});
It works good, but I do not need “Cancel” button in my design, fullscreen is canceling good with pressing “Esc” or “F11” buttons. And I need to run some function after this buttons was pressed, any ideas how can it be done?
Thanks,
Kuzzy.
Decided to scoop these up from the comments.
You could do it this way.
( Jsfiddle’s updated since I had accidentally deleted the ones shown in the comments )
http://jsfiddle.net/lollero/sxpam/
http://jsfiddle.net/lollero/sxpam/show/ – This link should be used to test the actual functionality.