У меня есть специалист по JQuery, который поможет мне здесь?JQuery 1.5.2 замените функцию .on()
У меня есть проект, который мне нужен для использования JQuery 1.5.2, и мне нужно использовать функцию .on().
Каков способ заставить его работать?
Модель код ниже:
$(document).on('mozfullscreenchange webkitfullscreenchange fullscreenchange',function(){
\t \t //some code
alert("fulscreen change")
\t \t });
function fullscreen() {
alert("full");
\t \t if (!document.fullscreenElement && // alternative standard method
\t \t !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { // current working methods
\t \t \t if (document.documentElement.requestFullscreen) {
\t \t \t document.documentElement.requestFullscreen();
\t \t \t } else if (document.documentElement.msRequestFullscreen) {
\t \t \t document.documentElement.msRequestFullscreen();
\t \t \t } else if (document.documentElement.mozRequestFullScreen) {
\t \t \t document.documentElement.mozRequestFullScreen();
\t \t \t } else if (document.documentElement.webkitRequestFullscreen) {
\t \t \t document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
\t \t \t }
\t \t \t } else {
\t \t \t if (document.exitFullscreen) {
\t \t \t document.exitFullscreen();
\t \t \t } else if (document.msExitFullscreen) {
\t \t \t document.msExitFullscreen();
\t \t \t } else if (document.mozCancelFullScreen) {
\t \t \t document.mozCancelFullScreen();
\t \t \t } else if (document.webkitExitFullscreen) {
\t \t \t document.webkitExitFullscreen();
\t \t \t }
\t \t \t }
\t }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<button onclick='fullscreen()'>fullscreen</button>
использование 'живой()' или 'делегат()' –
спасибо !!! @PranavCBalan –
Это путь! если вы хотите, вы можете ответить –