“javascript complet” Réponses codées

plein écran javascript

//creating a button and linking it to btnClicked()
document.onload=()=>{
  let btn = document.createElement("button");
  btn.textContent = 'Fulscreen!';
  btn.addEventListener('click', btnClicked);
  document.body.append(btn);
}

function btnClicked(){
  document
    .getElementById("%id of the element you want to fullscreen%")
    .requestFullscreen();
}

//to exit fullscreen
document.exitFullscreen();
Witty Whale

javascript complet

// element which needs to enter full-screen mode
var element = document.querySelector("#container");

// make the element go to full-screen mode
element.requestFullscreen()
	.then(function() {
		// element has entered fullscreen mode successfully
	})
	.catch(function(error) {
		// element could not enter fullscreen mode
	});
Mais Inc

Réponses similaires à “javascript complet”

Questions similaires à “javascript complet”

Plus de réponses similaires à “javascript complet” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code