Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript
JavaScript Forum programmation JavaScript. Lire : Cours JavaScript, FAQ JavaScript, Toutes les FAQ JavaScript et Sources JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
Vieux 15/03/2010, 17h54   #1
Membre du Club
 
Avatar de naima2005
 
Inscription : février 2006
Messages : 336
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : février 2006
Messages : 336
Points : 58
Points : 58
Envoyer un message via Yahoo à naima2005
Par défaut menu verstical dynamique

bonjour;
j'ai un problème dans la position du sous-menu d'un menu vertical avec FireFoxe, tout en sachant qu'avec IE ça marche
voici le code java script utilisé:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
bgcolor='#006699';
bgcolor2='#6699CC';
document.write('<style type="text/css">');
document.write('.popper { POSITION: absolute; VISIBILITY: hidden; z-index:15; left:99px ')
document.write('#topgauche { position:absolute;  z-index:10; }')
document.write('A:hover.ejsmenu {color:#FFFFFF; text-decoration:none;}')
document.write('.ejsmenu {color:#FFFFFF; text-decoration:none;}')
document.write('</style>')
document.write('<div style="position:relative;height:25"><DIV class=popper id=topdeck></DIV>');
/*
SCRIPT EDITE SUR L'EDITEUR JAVACSRIPT
*/

/*
LIENS
*/
zlien = new Array;
zlien[0] = new Array;
zlien[1] = new Array;
zlien[0][0] = '<A HREF="" CLASS=ejsmenu>Menu01</A>';
zlien[0][1] = '<A HREF="" CLASS=ejsmenu>Menu02</A>';
zlien[0][2] = '<A HREF="" CLASS=ejsmenu>Menu03</A>';
zlien[1][0] = '<A HREF="" CLASS=ejsmenu>Menu11</A>';
zlien[1][1] = '<A HREF="" CLASS=ejsmenu>Menu12</A>';
if(document.getElementById)
	{
	skn = document.getElementById("topdeck").style
	skn.left = 99;
	}

function pop(msg,pos)
{
skn.visibility = "hidden";
a=true
skn.top = pos;
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=150><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0
while (pass < msg.length)
	{
	content += "<TR><TD BGCOLOR="+bgcolor+" onMouseOver=\"this.style.background='"+bgcolor2+"'\" onMouseOut=\"this.style.background='"+bgcolor+"'\" HEIGHT=20><FONT SIZE=1 FACE=\"Verdana\">&nbsp;&nbsp;"+msg[pass]+"</FONT></TD></TR>";
	pass++;
	}
content += "</TABLE></TD></TR></TABLE>";
document.getElementById("topdeck").innerHTML = content;
skn.visibility = "visible";
}
function kill()
{
	if(document.getElementById)
		skn.visibility = "hidden";
}
document.onclick = kill;
if(document.getElementById)
	{
	document.write('<DIV ID=topgauche><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=100 HEIGHT=40><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100% HEIGHT=40>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor2+'\';pop(zlien[0],0)" onMouseOut="this.style.background=\''+bgcolor+'\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Menu1</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor2+'\';pop(zlien[1],20)" onMouseOut="this.style.background=\''+bgcolor+'\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Menu2</FONT></TD></tr>')
	document.write('</TABLE></TD></TR></TABLE></DIV>')
	}
document.write('</div>');
je vous remercie pour votre aide

Dernière modification par Sendusha ; 01/06/2011 à 06h53.
naima2005 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/03/2010, 20h17   #2
Expert Confirmé Sénior
 
Avatar de Auteur
 
Inscription : avril 2004
Messages : 4 710
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : avril 2004
Messages : 4 710
Points : 4 999
Points : 4 999
document.write()

Il a combien d'années ce script ?
Auteur est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/03/2010, 21h50   #3
Membre du Club
 
Avatar de naima2005
 
Inscription : février 2006
Messages : 336
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : février 2006
Messages : 336
Points : 58
Points : 58
Envoyer un message via Yahoo à naima2005
je ne sais pas mais il me semble bien sauf le pb du firefoxe
alors si vous avez un script plus évolué je te serai reconnaissante.
naima2005 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 17/03/2010, 06h11   #4
Rédacteur/Modérateur
 
Avatar de andry.aime
 
Homme Andry Aimé
Inscription : septembre 2007
Messages : 4 774
Détails du profil
Informations personnelles :
Nom : Homme Andry Aimé
Localisation : Ile Maurice

Informations forums :
Inscription : septembre 2007
Messages : 4 774
Points : 6 723
Points : 6 723
Bonjour,
N'utilises plus ce document.write, utilises DOM pour la création du tableau et tu peux voir ici sa manipulation, sinon tu peux utiliser innerHTML qui est tolérable.
andry.aime est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +1. Il est actuellement 23h41.


 
 
 
 
Partenaires

Hébergement Web