Onclick javascript
beeby
Messages postés
4
Date d'inscription
Statut
Membre
Dernière intervention
-
beeby Messages postés 4 Date d'inscription Statut Membre Dernière intervention -
beeby Messages postés 4 Date d'inscription Statut Membre Dernière intervention -
Salut les ga, j'ai un petit souci avec un code java window.blur() si quelqu'un pourai m'aide.
la fenetre ne veux pas s'ouvrir en arriere plan..
<script>
function below()
{
Url = new Array;
Url[0] = "https://www.commentcamarche.net/";
Url[1] = "https://www.facebook.com/";
ChoixLien = Math.floor(Math.random() * Url.length)
win=window.open(Url[ChoixLien],"mywindow",'toolbar=0,scrollbars=0,width=1366,height=768');
setTimeout("win.close()",2000);
window.blur();
}
</script>
<body>
<input type="button" VALUE="Click!" onClick="below()">
</body>
</html>
la fenetre ne veux pas s'ouvrir en arriere plan..
<script>
function below()
{
Url = new Array;
Url[0] = "https://www.commentcamarche.net/";
Url[1] = "https://www.facebook.com/";
ChoixLien = Math.floor(Math.random() * Url.length)
win=window.open(Url[ChoixLien],"mywindow",'toolbar=0,scrollbars=0,width=1366,height=768');
setTimeout("win.close()",2000);
window.blur();
}
</script>
<body>
<input type="button" VALUE="Click!" onClick="below()">
</body>
</html>
A voir également:
- Onclick javascript
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Handicap / Accessibilté
- Erreur #125 javascript - Forum Mozilla Firefox
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Javascript arrondi - Forum Javascript
3 réponses
salut je ne suis pas sur que cela repond a ta question car je n'ai pas tro compris ton probleme mais essay ce morceaux de code
<script> function below() { Url = new Array; Url[0] = "https://www.commentcamarche.net/"; Url[1] = "https://www.facebook.com/"; ChoixLien = Math.floor(Math.random() * Url.length) win=window.open(Url[ChoixLien],"mywindow",'toolbar=0,scrollbars=0,width=1366,height=768'); //setTimeout("win.close()",2000); win.blur(); } </script> <body> <input type="button" VALUE="Click!" onClick="below()"> </body> </html>
ok essaies ca
<html> <script type="text/javascript"> function openUnder(url, width, height) { var openUnderWindow, nav = navigator.userAgent, isGecko = /rv:[2-9]/.exec(nav), hackString; hackString = nav.indexOf('Chrome') > -1 ? "scrollbar=yes" : "toolbar=0,statusbar=1,resizable=1,scrollbars=0,menubar=0,location=1,directories=0"; openUnderWindow = window.open("about:blank", "title", hackString + ",height=" + height + ",width=" + width); if (isGecko) { openUnderWindow.window.open("about:blank").close(); } openUnderWindow.document.location.href = url; setTimeout(window.focus); window.focus(); openUnderWindow.blur(); } function below() { Url = new Array; Url[0] = "https://www.commentcamarche.net/"; Url[1] = "https://www.facebook.com/"; ChoixLien = Math.floor(Math.random() * Url.length) openUnder(Url[ChoixLien], 800, 768); return false; } </script> <body> <input type="button" VALUE="Click!" onClick="below()"> </body> </html>
J'ai reussi a faire un petit quelque chose mais le code me parai bizarr...au niveaux du win.open.
<script>
function below()
{
Url = new Array;
Url[0] = "https://www.commentcamarche.net/";
Url[1] = "https://www.facebook.com/";
ChoixLien = Math.floor(Math.random() * Url.length)
win=window.open(Url[ChoixLien],"mywindow",'toolbar=0,scrollbars=0,width=1366,height=768');
win.open("win.blur");
setTimeout("win.close()",2000);
}
</script>
<body>
<input type="button" VALUE="Click!" onClick="below()">
</body>
</html>
<script>
function below()
{
Url = new Array;
Url[0] = "https://www.commentcamarche.net/";
Url[1] = "https://www.facebook.com/";
ChoixLien = Math.floor(Math.random() * Url.length)
win=window.open(Url[ChoixLien],"mywindow",'toolbar=0,scrollbars=0,width=1366,height=768');
win.open("win.blur");
setTimeout("win.close()",2000);
}
</script>
<body>
<input type="button" VALUE="Click!" onClick="below()">
</body>
</html>
Salut, msarah merci pour ton aide, j'ai un petit souci avec le code window.blur() je voudrai faire apparaitre le lien en arriere plan. C'est a dire que la page s'ouvre entre la page sur la quelle je suis et mon fond d'ecran si tu vois se que je veux dire...je fais mais essai sur https://www.w3schools.com/js/ mais sans sucsses..