Adapt Fullscreen Api to toggle swith
up vote
0
down vote
favorite
I would try to adapt two code in one.
First the fullscreen Api HTML5 Fullscreen Api and Sliding Toggle Switch like (iOS) jQuery-Plugin-For-Sliding-Toggle-Switches.
function launchFullscreen(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
function cancelFullscreen() {
if(document.cancelFullScreen) {
document.cancelFullScreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
// triggered each time a field changes status
$('body').delegate('.lcs_check', 'lcs-statuschange', function() {
var status = ($(this).is(':checked')) ? 'checked' : 'unchecked';
console.log('field changed status: '+ status );
});
// triggered each time a field is checked
$('body').delegate('.lcs_check', 'lcs-on', function() {
console.log('field is checked');
});
// triggered each time a is unchecked
$('body').delegate('.lcs_check', 'lcs-off', function() {
console.log('field is unchecked');
});
I require your help to have a Sliding Toggle Switch button to activate and deactivate Fullscreen mode. Too I would test that the fullscreen mode is activated by default. I don't know if the LC Switch does it in the function.
I do not quite understand jquery and even less when I must adapt javascript with jquery.
It could be useful for other users :-)
in advance thank you.
html5-fullscreen toggleswitch
add a comment |
up vote
0
down vote
favorite
I would try to adapt two code in one.
First the fullscreen Api HTML5 Fullscreen Api and Sliding Toggle Switch like (iOS) jQuery-Plugin-For-Sliding-Toggle-Switches.
function launchFullscreen(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
function cancelFullscreen() {
if(document.cancelFullScreen) {
document.cancelFullScreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
// triggered each time a field changes status
$('body').delegate('.lcs_check', 'lcs-statuschange', function() {
var status = ($(this).is(':checked')) ? 'checked' : 'unchecked';
console.log('field changed status: '+ status );
});
// triggered each time a field is checked
$('body').delegate('.lcs_check', 'lcs-on', function() {
console.log('field is checked');
});
// triggered each time a is unchecked
$('body').delegate('.lcs_check', 'lcs-off', function() {
console.log('field is unchecked');
});
I require your help to have a Sliding Toggle Switch button to activate and deactivate Fullscreen mode. Too I would test that the fullscreen mode is activated by default. I don't know if the LC Switch does it in the function.
I do not quite understand jquery and even less when I must adapt javascript with jquery.
It could be useful for other users :-)
in advance thank you.
html5-fullscreen toggleswitch
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would try to adapt two code in one.
First the fullscreen Api HTML5 Fullscreen Api and Sliding Toggle Switch like (iOS) jQuery-Plugin-For-Sliding-Toggle-Switches.
function launchFullscreen(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
function cancelFullscreen() {
if(document.cancelFullScreen) {
document.cancelFullScreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
// triggered each time a field changes status
$('body').delegate('.lcs_check', 'lcs-statuschange', function() {
var status = ($(this).is(':checked')) ? 'checked' : 'unchecked';
console.log('field changed status: '+ status );
});
// triggered each time a field is checked
$('body').delegate('.lcs_check', 'lcs-on', function() {
console.log('field is checked');
});
// triggered each time a is unchecked
$('body').delegate('.lcs_check', 'lcs-off', function() {
console.log('field is unchecked');
});
I require your help to have a Sliding Toggle Switch button to activate and deactivate Fullscreen mode. Too I would test that the fullscreen mode is activated by default. I don't know if the LC Switch does it in the function.
I do not quite understand jquery and even less when I must adapt javascript with jquery.
It could be useful for other users :-)
in advance thank you.
html5-fullscreen toggleswitch
I would try to adapt two code in one.
First the fullscreen Api HTML5 Fullscreen Api and Sliding Toggle Switch like (iOS) jQuery-Plugin-For-Sliding-Toggle-Switches.
function launchFullscreen(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
function cancelFullscreen() {
if(document.cancelFullScreen) {
document.cancelFullScreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
// triggered each time a field changes status
$('body').delegate('.lcs_check', 'lcs-statuschange', function() {
var status = ($(this).is(':checked')) ? 'checked' : 'unchecked';
console.log('field changed status: '+ status );
});
// triggered each time a field is checked
$('body').delegate('.lcs_check', 'lcs-on', function() {
console.log('field is checked');
});
// triggered each time a is unchecked
$('body').delegate('.lcs_check', 'lcs-off', function() {
console.log('field is unchecked');
});
I require your help to have a Sliding Toggle Switch button to activate and deactivate Fullscreen mode. Too I would test that the fullscreen mode is activated by default. I don't know if the LC Switch does it in the function.
I do not quite understand jquery and even less when I must adapt javascript with jquery.
It could be useful for other users :-)
in advance thank you.
html5-fullscreen toggleswitch
html5-fullscreen toggleswitch
asked Nov 13 at 16:51
Raphael Kuhn
104
104
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Here, I received an answer from another forum.
jQuery('body').delegate('.lcs_check', 'lcs-statuschange', function() {
if(jQuery(this).is(':checked')){
launchFullscreen(document.documentElement); // the whole page
} else {
cancelFullscreen();
}
});
It works but i have a bug/problem only on Chrome browser and I haven't error in the console.
The switch button always works in two modes (ON and OFF) but it doesn't exit full screen on "OFF" only if the window browser is in fullscreen. If the window browser is reduce it works fine.
I have well an alert to exit fullscreen on "ON" but I must insist to exit: esc + click two times (shift+command+F).
This problem doesn't appear on other browsers (Safari, Firefox and Opera). I have not yet tested on IE 11.
I failed to get a valid link from GitHub for LC_Switch.js, I can't show you an example.
Somebody as an idea where come from the problem?
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Here, I received an answer from another forum.
jQuery('body').delegate('.lcs_check', 'lcs-statuschange', function() {
if(jQuery(this).is(':checked')){
launchFullscreen(document.documentElement); // the whole page
} else {
cancelFullscreen();
}
});
It works but i have a bug/problem only on Chrome browser and I haven't error in the console.
The switch button always works in two modes (ON and OFF) but it doesn't exit full screen on "OFF" only if the window browser is in fullscreen. If the window browser is reduce it works fine.
I have well an alert to exit fullscreen on "ON" but I must insist to exit: esc + click two times (shift+command+F).
This problem doesn't appear on other browsers (Safari, Firefox and Opera). I have not yet tested on IE 11.
I failed to get a valid link from GitHub for LC_Switch.js, I can't show you an example.
Somebody as an idea where come from the problem?
add a comment |
up vote
0
down vote
Here, I received an answer from another forum.
jQuery('body').delegate('.lcs_check', 'lcs-statuschange', function() {
if(jQuery(this).is(':checked')){
launchFullscreen(document.documentElement); // the whole page
} else {
cancelFullscreen();
}
});
It works but i have a bug/problem only on Chrome browser and I haven't error in the console.
The switch button always works in two modes (ON and OFF) but it doesn't exit full screen on "OFF" only if the window browser is in fullscreen. If the window browser is reduce it works fine.
I have well an alert to exit fullscreen on "ON" but I must insist to exit: esc + click two times (shift+command+F).
This problem doesn't appear on other browsers (Safari, Firefox and Opera). I have not yet tested on IE 11.
I failed to get a valid link from GitHub for LC_Switch.js, I can't show you an example.
Somebody as an idea where come from the problem?
add a comment |
up vote
0
down vote
up vote
0
down vote
Here, I received an answer from another forum.
jQuery('body').delegate('.lcs_check', 'lcs-statuschange', function() {
if(jQuery(this).is(':checked')){
launchFullscreen(document.documentElement); // the whole page
} else {
cancelFullscreen();
}
});
It works but i have a bug/problem only on Chrome browser and I haven't error in the console.
The switch button always works in two modes (ON and OFF) but it doesn't exit full screen on "OFF" only if the window browser is in fullscreen. If the window browser is reduce it works fine.
I have well an alert to exit fullscreen on "ON" but I must insist to exit: esc + click two times (shift+command+F).
This problem doesn't appear on other browsers (Safari, Firefox and Opera). I have not yet tested on IE 11.
I failed to get a valid link from GitHub for LC_Switch.js, I can't show you an example.
Somebody as an idea where come from the problem?
Here, I received an answer from another forum.
jQuery('body').delegate('.lcs_check', 'lcs-statuschange', function() {
if(jQuery(this).is(':checked')){
launchFullscreen(document.documentElement); // the whole page
} else {
cancelFullscreen();
}
});
It works but i have a bug/problem only on Chrome browser and I haven't error in the console.
The switch button always works in two modes (ON and OFF) but it doesn't exit full screen on "OFF" only if the window browser is in fullscreen. If the window browser is reduce it works fine.
I have well an alert to exit fullscreen on "ON" but I must insist to exit: esc + click two times (shift+command+F).
This problem doesn't appear on other browsers (Safari, Firefox and Opera). I have not yet tested on IE 11.
I failed to get a valid link from GitHub for LC_Switch.js, I can't show you an example.
Somebody as an idea where come from the problem?
answered Nov 18 at 16:24
Raphael Kuhn
104
104
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285875%2fadapt-fullscreen-api-to-toggle-swith%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown