begin process at 2010 02 10 05:27:45
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Navigation

 > OUVERTURE POPUP À URL ALÉATOIRE

OUVERTURE POPUP À URL ALÉATOIRE


 Information sur la source

Note :
10 / 10 - par 1 personne
10,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Navigation Niveau :Débutant Date de création :19/12/2003 Vu :10 138

Auteur : Deny

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Ouverture ici automatique au chargement de la page.
Aléatoire parmi une liste d'URL définis en Array.
Popup positionnée et dimensionnée, selon screen.width, en %.

Source

  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  • <html>
  • <head>
  • <SCRIPT LANGUAGE="JavaScript">
  • //URL de la page a ouvrir Dans pop-under
  • function ow(theURL,larg,haut)
  • <!------ mettre larg à 77 pour ouvrir à 100% en 800---------->
  • {
  • info = null;
  • larg = Math.ceil(screen.width * (larg/100)*(1024/screen.width));
  • haut = Math.ceil(screen.height * (haut/100));
  • <!------ position en 5/5 screenX Y et outerwidth netscape---------->
  • if(info) {info.close();
  • info = window.open(theURL,"info1","scrollbars=yes,menubar=yes,resizable=yes,width="+ larg +"px,height="+ haut +"px,outerwidth="+ larg +"px,outerheight="+ haut +"px,top=5,left=5,screenX=5,screenY=5");
  • info.focus();
  • }
  • else {
  • info = window.open(theURL,"info1","scrollbars=yes,menubar=yes,resizable=yes,width="+ larg +"px,height="+ haut +"px,outerwidth="+ larg +"px,outerheight="+ haut +"px,top=5,left=5,screenX=5,screenY=5");
  • info.focus();
  • }
  • }
  • var popunder= new String();
  • var popun=new Array();
  • var resultat = 0;
  • popun[0]="http://www.allhtml.com/" ;
  • popun[1]="http://www.javascriptfr.com/" ;
  • popun[2]="http://www.javascript.com/" ;
  • popun[3]="http://www.internet.com/" ;
  • function calcarray() {
  • resultat = Math.round(Math.random()*10);
  • <!----- ici 3 max array -------->
  • if( resultat > 3) {calcarray();}
  • popunder= popun[resultat];
  • }
  • calcarray();
  • <!---- 65 en% larg 70 en % haut------->
  • ow(popunder,65,70);
  • </SCRIPT>
  • </head>
  • <body>
  • <p>Hello</p>
  • </body>
  • </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
//URL de la page a ouvrir Dans pop-under 
function ow(theURL,larg,haut) 
<!------ mettre larg à 77 pour ouvrir à 100% en 800---------->
	{
info = null;
larg = Math.ceil(screen.width * (larg/100)*(1024/screen.width));
haut = Math.ceil(screen.height * (haut/100));
<!------ position en 5/5 screenX Y et outerwidth netscape---------->
			if(info) {info.close();
				info =	window.open(theURL,"info1","scrollbars=yes,menubar=yes,resizable=yes,width="+ larg +"px,height="+ haut +"px,outerwidth="+ larg +"px,outerheight="+ haut +"px,top=5,left=5,screenX=5,screenY=5");
				info.focus();
				}
			else {
				info =	window.open(theURL,"info1","scrollbars=yes,menubar=yes,resizable=yes,width="+ larg +"px,height="+ haut +"px,outerwidth="+ larg +"px,outerheight="+ haut +"px,top=5,left=5,screenX=5,screenY=5");
				info.focus();
				}
	}
var popunder= new String(); 
var popun=new Array(); 
var resultat = 0; 
popun[0]="http://www.allhtml.com/" ;
popun[1]="http://www.javascriptfr.com/" ;
popun[2]="http://www.javascript.com/" ;
popun[3]="http://www.internet.com/" ;

function calcarray() { 
resultat = Math.round(Math.random()*10);
<!----- ici 3 max array -------->
if( resultat > 3) {calcarray();} 
popunder= popun[resultat]; 
} 
calcarray();
<!---- 65 en% larg 70 en % haut------->
ow(popunder,65,70);

</SCRIPT>

</head>
<body>
<p>Hello</p>
</body>
</html>

 Conclusion

Donnez des idées à vos visiteurs !


 Sources du même auteur

DHTML - MANIP CSS
Source avec Zip 96 SITES RÉPERTORIÉS : HTML, CSS, DHTML, JAVA, JAVASCRIPT, P...
BROWSER SNIFFER (RENIFLEUR)
Source avec Zip DHTML SCROLLTOP
PATIENTEZ + DATES MANIP

 Sources de la même categorie

Source avec Zip EMULATION DE $_GET() DU PHP par jchan
Source avec Zip ACCESSIBARRE - AMÉLIORER LE CONFORT DES PERSONNES NON-VOYANT... par Pfuch
Source avec Zip CLASS BARRE DE DÉFILEMENT (SCROLLBAR) JAVASCRIPT par TheWeasel47
Source avec une capture TAILLEFONTE par tiger222
Source avec Zip Source avec une capture MOTEUR DE RECHERCHE SANS PHP par jdmcreator

Commentaires et avis

Commentaire de winny33 le 10/05/2005 23:42:44

slt a vous:
une question il existe pas parraille mes pas en popup?

Commentaire de mgiran le 02/05/2009 14:47:53

Superbe mais j'ai un problème pour configurer le popup aléatoire aux dimensions que je souhaite : 700 / 250 pixels
Bien sûr il s'ouvre et je peux le redimensionner mais à l'ouverture il est assez petit ...Comment faire pour qu'il s'ouvre en 700 / 250 ?

mERCI

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix


HTC Hero

Entre 550€ et 550€

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,421 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales