IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

[Debutant] Mettre 2 javascript sur une page


Sujet :

JavaScript

  1. #1
    Membre régulier Avatar de hugo69
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    512
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2005
    Messages : 512
    Points : 122
    Points
    122
    Par défaut [Debutant] Mettre 2 javascript sur une page
    Bonjour,
    Je tatonne à peine en javascript.

    J'ai 2 scripts différents sur la même page.

    Je les appel de cette facon:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <SCRIPT language="JavaScript1.2" src="Scripts/StyleWebmasterMain.js" type="text/javascript"></SCRIPT> 
    <SCRIPT SRC="Scripts/LinkCadre.js" language="JavaScript1.2"></SCRIPT>
    Si je met le deuxième appel, le premier effet ne fonctionne plus.

    Un premier a pour vocation à faire un mouseover avec des effets.
    Le second un mouseover tout simple, genre une commande alt, mais qui réagit instantanément et qui est plus jolie.

    Y a til une facon d'appeler les 2 fichiers sur la meme ligne?
    Est ce que ces informations sont suffisantes?

    Merci

  2. #2
    Membre confirmé
    Profil pro
    Développeur Web
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 557
    Points
    557
    Par défaut
    c'est possible de le faire comme tu as fait, mais peut etre qu'un script empiète sur l'autre (au niveau de variables, fonctions ou autre), et qui fait que le premier ne marche plus lorsque tu inclus le second...
    Merci à Microsoft pour avoir transformé un métier relativement terne et basé sur une approche bêtement technique et rigoureuse des faits, en challenge quotidien, nécessitant une remise en question permanente à l'échelle du quart d'heure

  3. #3
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 289
    Points
    3 289
    Par défaut
    Oui, je pencherais pour un conflit de gestion d'evenements sur document...
    En gros, il tente d'acceder au même evenement et l'un empeche l'autre d'y acceder...
    Va falloir trouver un compromis...
    Sans les scripts, c'est impossibles...
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  4. #4
    Membre régulier Avatar de hugo69
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    512
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2005
    Messages : 512
    Points : 122
    Points
    122
    Par défaut
    cest ce que je pensais, moi je penchais pour les variables, puisque le seconde script, enfin le second effet marche mais pas le premier.

    Je met tout de meme les deux script.

    JE vais commencer par le second qui est plus leger:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    /***********************************************
    * Cool DHTML tooltip script II
    ***********************************************/
     
    var offsetfromcursorX=12 //Customize x offset of tooltip
    var offsetfromcursorY=10 //Customize y offset of tooltip
     
    var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
    var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
     
    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
    document.write('<img id="dhtmlpointer" src="assets/pict/linkcadre.gif">') //write out pointer image
     
    var ie=document.all
    var ns6=document.getElementById && !document.all
    var enabletip=false
    if (ie||ns6)
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
     
    var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
     
    function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
     
    function ddrivetip(thetext, thewidth, thecolor){
    if (ns6||ie){
    if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
    if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
    tipobj.innerHTML=thetext
    enabletip=true
    return false
    }
    }
     
    function positiontip(e){
    if (enabletip){
    var nondefaultpos=false
    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    //Find out how close the mouse is to the corner of the window
    var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
    var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
     
    var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
    var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
     
    var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
     
    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<tipobj.offsetWidth){
    //move the horizontal position of the menu to the left by it's width
    tipobj.style.left=curX-tipobj.offsetWidth+"px"
    nondefaultpos=true
    }
    else if (curX<leftedge)
    tipobj.style.left="5px"
    else{
    //position the horizontal position of the menu where the mouse is positioned
    tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
    pointerobj.style.left=curX+offsetfromcursorX+"px"
    }
     
    //same concept with the vertical position
    if (bottomedge<tipobj.offsetHeight){
    tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
    nondefaultpos=true
    }
    else{
    tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
    pointerobj.style.top=curY+offsetfromcursorY+"px"
    }
    tipobj.style.visibility="visible"
    if (!nondefaultpos)
    pointerobj.style.visibility="visible"
    else
    pointerobj.style.visibility="hidden"
    }
    }
     
    function hideddrivetip(){
    if (ns6||ie){
    enabletip=false
    tipobj.style.visibility="hidden"
    pointerobj.style.visibility="hidden"
    tipobj.style.left="-1000px"
    tipobj.style.backgroundColor=''
    tipobj.style.width=''
    }
    }
     
    document.onmousemove=positiontip

    et le premier qui est en fait sur 2JS.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    <!-- 
    /*
     Pleas leave this notice.
     DHTML tip message version 1.2 copyright Essam Gamal 2003 (http://migoicons.tripod.com, migoicons@hotmail.com)
     All modifications are done in the style.js you should not modify this file.  Created on : 06/03/2003
     Script featured on and can be found at Dynamic Drive (http://www.dynamicdrive.com)
    */ 
     
    var ua = navigator.userAgent
    var ps = navigator.productSub 
    var dom = (document.getElementById)? 1:0
    var ie4 = (document.all&&!dom)? 1:0
    var ie5 = (document.all&&dom)? 1:0
    var nn4 =(navigator.appName.toLowerCase() == "netscape" && parseInt(navigator.appVersion) == 4)
    var nn6 = (dom&&!ie5)? 1:0
    var sNav = (nn4||nn6||ie4||ie5)? 1:0
    var cssFilters = ((ua.indexOf("MSIE 5.5")>=0||ua.indexOf("MSIE 6")>=0)&&ua.indexOf("Opera")<0)? 1:0
    var Style=[],Text=[],Count=0,sbw=0,move=0,hs="",mx,my,scl,sct,ww,wh,obj,sl,st,ih,iw,vl,hl,sv,evlh,evlw,tbody
    var HideTip = "eval(obj+sv+hl+';'+obj+sl+'=0;'+obj+st+'=-800')"
    var doc_root = ((ie5&&ua.indexOf("Opera")<0||ie4)&&document.compatMode=="CSS1Compat")? "document.documentElement":"document.body"
    var PX = (nn6)? "px" :"" 
     
    if(sNav) {
    	window.onresize = ReloadTip
    	document.onmousemove = MoveTip
    	if(nn4) document.captureEvents(Event.MOUSEMOVE) 
    }	
    if(nn4||nn6) {
    	mx = "e.pageX"
    	my = "e.pageY"
    	scl = "window.pageXOffset"
    	sct = "window.pageYOffset"	
    	if(nn4) {
    		obj = "document.TipLayer."
    		sl = "left"
    		st = "top"
    		ih = "clip.height"
    		iw = "clip.width"
    		vl = "'show'"
    		hl = "'hide'"
    		sv = "visibility="
    	}
    	else obj = "document.getElementById('TipLayer')."
    } 
    if(ie4||ie5) {
    	obj = "TipLayer."
    	mx = "event.x"
    	my = "event.y"
    	scl = "eval(doc_root).scrollLeft"
    	sct = "eval(doc_root).scrollTop"
    	if(ie5) {
    		mx = mx+"+"+scl 
    		my = my+"+"+sct
    	}
    }
    if(ie4||dom){
    	sl = "style.left"
    	st = "style.top"
    	ih = "offsetHeight"
    	iw = "offsetWidth"
    	vl = "'visible'"
    	hl = "'hidden'"
    	sv = "style.visibility="
    }
    if(ie4||ie5||ps>=20020823) {
    	ww = "eval(doc_root).clientWidth"
    	wh = "eval(doc_root).clientHeight"
    }	 
    else { 
    	ww = "window.innerWidth"
    	wh = "window.innerHeight"
    	evlh = eval(wh)
    	evlw = eval(ww)
    	sbw=15
    }	
     
    function applyCssFilter(){
    	if(cssFilters&&FiltersEnabled) { 
    		var dx = " progid:DXImageTransform.Microsoft."
    		TipLayer.style.filter = "revealTrans()"+dx+"Fade(Overlap=1.00 enabled=0)"+dx+"Inset(enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=in enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=out enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=in enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=out enabled=0)"+dx+"Iris(irisstyle=STAR,motion=in enabled=0)"+dx+"Iris(irisstyle=STAR,motion=out enabled=0)"+dx+"RadialWipe(wipestyle=CLOCK enabled=0)"+dx+"RadialWipe(wipestyle=WEDGE enabled=0)"+dx+"RadialWipe(wipestyle=RADIAL enabled=0)"+dx+"Pixelate(MaxSquare=35,enabled=0)"+dx+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+dx+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"+dx+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+dx+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"+dx+"Stretch(stretchstyle=HIDE enabled=0)"+dx+"Stretch(stretchstyle=PUSH enabled=0)"+dx+"Stretch(stretchstyle=SPIN enabled=0)"+dx+"Wheel(spokes=16 enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"+dx+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+dx+"Alpha(enabled=0)"+dx+"Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"+dx+"Shadow(strength=3,direction=135,enabled=0)"
    	}
    }
     
    function stm(t,s) {
      if(sNav) {
      	if(t.length<2||s.length<25) {
    		var ErrorNotice = "DHTML TIP MESSAGE VERSION 1.2 ERROR NOTICE.\n"
    		if(t.length<2&&s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array and Text Array of this tip.\nTheir should be 25 entries in every Style Array even though empty and 2 in every Text Array. You defined only "+s.length+" entries in the Style Array and "+t.length+" entry in the Text Array. This tip won't be viewed to avoid errors")
    		else if(t.length<2) alert(ErrorNotice+"It looks like you removed an entry or more from the Text Array of this tip.\nTheir should be 2 entries in every Text Array. You defined only "+t.length+" entry. This tip won't be viewed to avoid errors.")
    		else if(s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array of this tip.\nTheir should be 25 entries in every Style Array even though empty. You defined only "+s.length+" entries. This tip won't be viewed to avoid errors.")
     	}
      	else {
    		var ab = "" ;var ap = ""
    		var titCol = (s[0])? "COLOR='"+s[0]+"'" : ""
    		var txtCol = (s[1])? "COLOR='"+s[1]+"'" : ""
    		var titBgCol = (s[2])? "BGCOLOR='"+s[2]+"'" : ""
    		var txtBgCol = (s[3])? "BGCOLOR='"+s[3]+"'" : ""
    		var titBgImg = (s[4])? "BACKGROUND='"+s[4]+"'" : ""	
    		var txtBgImg = (s[5])? "BACKGROUND='"+s[5]+"'" : ""
    		var titTxtAli = (s[6] && s[6].toLowerCase()!="left")? "ALIGN='"+s[6]+"'" : ""
    		var txtTxtAli = (s[7] && s[7].toLowerCase()!="left")? "ALIGN='"+s[7]+"'" : ""   
    		var add_height = (s[15])? "HEIGHT='"+s[15]+"'" : ""
    		if(!s[8])  s[8] = "Verdana,Arial,Helvetica"
    		if(!s[9])  s[9] = "Verdana,Arial,Helvetica"					
    		if(!s[12]) s[12] = 1
    		if(!s[13]) s[13] = 1
    		if(!s[14]) s[14] = 200
    		if(!s[16]) s[16] = 0
    		if(!s[17]) s[17] = 0
    		if(!s[18]) s[18] = 10
    		if(!s[19]) s[19] = 10
    		hs = s[11].toLowerCase() 
    		if(ps==20001108){
    		if(s[2]) ab="STYLE='border:"+s[16]+"px solid"+" "+s[2]+"'"
    		ap="STYLE='padding:"+s[17]+"px "+s[17]+"px "+s[17]+"px "+s[17]+"px'"}
    		var closeLink=(hs=="sticky")? "<TD ALIGN='right'><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"'><A HREF='javascript:void(0)' ONCLICK='stickyhide()' STYLE='text-decoration:none;color:"+s[0]+"'><B>Close</B></A></FONT></TD>":""
    		var title=(t[0]||hs=="sticky")? "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0'><TR><TD "+titTxtAli+"><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"' "+titCol+"><B>"+t[0]+"</B></FONT></TD>"+closeLink+"</TR></TABLE>" : ""
    		var txt="<TABLE "+titBgImg+" "+ab+" WIDTH='"+s[14]+"' BORDER='0' CELLPADDING='"+s[16]+"' CELLSPACING='0' "+titBgCol+" ><TR><TD>"+title+"<TABLE WIDTH='100%' "+add_height+" BORDER='0' CELLPADDING='"+s[17]+"' CELLSPACING='0' "+txtBgCol+" "+txtBgImg+"><TR><TD "+txtTxtAli+" "+ap+" VALIGN='top'><FONT SIZE='"+s[13]+"' FACE='"+s[9]+"' "+txtCol +">"+t[1]+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
    		if(nn4) {
    			with(eval(obj+"document")) {
    				open()
    				write(txt)
    				close()
    			}
    		}
    		else eval(obj+"innerHTML=txt")
    		tbody = {
    			Pos:s[10].toLowerCase(), 
    			Xpos:s[18],
    			Ypos:s[19], 
    			Transition:s[20],
    			Duration:s[21], 
    			Alpha:s[22],
    			ShadowType:s[23].toLowerCase(),
    			ShadowColor:s[24],
    			Width:parseInt(eval(obj+iw)+3+sbw)
    		}
    		if(ie4) { 
    			TipLayer.style.width = s[14]
    	 		tbody.Width = s[14]
    		}
    		Count=0	
    		move=1
     	 }
      }
    }
     
    function MoveTip(e) {
    	if(move) {
    		var X,Y,MouseX = eval(mx),MouseY = eval(my); tbody.Height = parseInt(eval(obj+ih)+3)
    		tbody.wiw = parseInt(eval(ww+"+"+scl)); tbody.wih = parseInt(eval(wh+"+"+sct))
    		switch(tbody.Pos) {
    			case "left" : X=MouseX-tbody.Width-tbody.Xpos; Y=MouseY+tbody.Ypos; break
    			case "center": X=MouseX-(tbody.Width/2); Y=MouseY+tbody.Ypos; break
    			case "float": X=tbody.Xpos+eval(scl); Y=tbody.Ypos+eval(sct); break	
    			case "fixed": X=tbody.Xpos; Y=tbody.Ypos; break		
    			default: X=MouseX+tbody.Xpos; Y=MouseY+tbody.Ypos
    		}
     
    		if(tbody.wiw<tbody.Width+X) X = tbody.wiw-tbody.Width
    		if(tbody.wih<tbody.Height+Y+sbw) {
    			if(tbody.Pos=="float"||tbody.Pos=="fixed") Y = tbody.wih-tbody.Height-sbw
    			else Y = MouseY-tbody.Height
    		}
    		if(X<0) X=0 
    		eval(obj+sl+"=X+PX;"+obj+st+"=Y+PX")
    		ViewTip()
    	}
    }
     
    function ViewTip() {
      	Count++
    	if(Count == 1) {
    		if(cssFilters&&FiltersEnabled) {	
    			for(Index=28; Index<31; Index++) { TipLayer.filters[Index].enabled = 0 }
    			for(s=0; s<28; s++) { if(TipLayer.filters[s].status == 2) TipLayer.filters[s].stop() }
    			if(tbody.Transition == 51) tbody.Transition = parseInt(Math.random()*50)
    			var applyTrans = (tbody.Transition>-1&&tbody.Transition<24&&tbody.Duration>0)? 1:0
    			var advFilters = (tbody.Transition>23&&tbody.Transition<51&&tbody.Duration>0)? 1:0
    			var which = (applyTrans)?0:(advFilters)? tbody.Transition-23:0 
    			if(tbody.Alpha>0&&tbody.Alpha<100) {
    	  			TipLayer.filters[28].enabled = 1
    	  			TipLayer.filters[28].opacity = tbody.Alpha
    			}
    			if(tbody.ShadowColor&&tbody.ShadowType == "simple") {
    	  			TipLayer.filters[29].enabled = 1
    	  			TipLayer.filters[29].color = tbody.ShadowColor
    			}
    			else if(tbody.ShadowColor&&tbody.ShadowType == "complex") {
    	  			TipLayer.filters[30].enabled = 1
    	  			TipLayer.filters[30].color = tbody.ShadowColor
    			}
    			if(applyTrans||advFilters) {
    				eval(obj+sv+hl)
    	  			if(applyTrans) TipLayer.filters[0].transition = tbody.Transition
    	  			TipLayer.filters[which].duration = tbody.Duration 
    	  			TipLayer.filters[which].apply()
    			}
    		}
     		eval(obj+sv+vl)
    		if(cssFilters&&FiltersEnabled&&(applyTrans||advFilters)) TipLayer.filters[which].play()
    		if(hs == "sticky") move=0
      	}
    }
     
    function stickyhide() {
    	eval(HideTip)
    }
     
    function ReloadTip() {
    	 if(nn4&&(evlw!=eval(ww)||evlh!=eval(wh))) location.reload()
    	 else if(hs == "sticky") eval(HideTip)
    }
     
    function htm() {
    	if(sNav) {
    		if(hs!="keep") {
    			move=0; 
    			if(hs!="sticky") eval(HideTip)
    		}	
    	} 
    }
     
     
    //-->

    le js de configuration maintenant:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    /*
    Please refer to readme.html for full Instructions
     
    Text[...]=[title,text]
     
    Style[...]=[TitleColor,TextColor,TitleBgColor,TextBgColor,TitleBgImag,TextBgImag,TitleTextAlign,TextTextAlign, TitleFontFace, TextFontFace, TipPosition, StickyStyle, TitleFontSize, TextFontSize, Width, Height, BorderSize, PadTextArea, CoordinateX , CoordinateY, TransitionNumber, TransitionDuration, TransparencyLevel ,ShadowType, ShadowColor]
    */
     
    var FiltersEnabled = 1 // if your not going to use transitions or filters in any of the tips set this to 0
     
    Text[0]=["Bonjour","<BR>ceci est un test. "]
     
     
     
    Style[0]=["#336699","black","#A8FFFF","#FFFFFF","","","","center","","","","","","",200,"",2,2,10,10,51,1,90,"complex","666666"]
     
     
    applyCssFilter()
    Pourtant les variables sont nommées differemment, et je ne vois pas de fonction au nom identique

  5. #5
    Expert éminent sénior
    Avatar de Auteur
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    7 648
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 7 648
    Points : 11 137
    Points
    11 137
    Par défaut
    bonjour,

    Voir si l'origine des conflits n'est pas due à:
    - les premières parties de tes codes ne sont pas placées dans des fonctions (par où commencer ?).
    - Dans ton premier script, tu écris
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     document.onmousemove = positiontip
    Dans le second script, tu écris
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    document.onmousemove = MoveTip
    Il manque les parenthèses : MoveTip() ou positiontip(), en n'oubliant pas les arguments éventuels. De plus comme tu affectes deux fonctions pour un même événement : il y forcément une affectation qui passe à la trappe.
    - regarde la gestion des autres événements (mots clefs commençant par on...).
    - j'ai constaté la présence de document.write() : cette fonction te permets d'ajouter des éléments dans la page. Regarde si cette fonction n'en supprime pas ou ne créé pas des doublons.

    Pour voir si on ne peut pas allèger ton script :
    >Que sont censés faire ces scripts (que se passe-t-il lors du onmouseover, onmouseout, onmouseclick etc...)? Peux-tu me décrire ce qui se passe ?
    >Ne peux-tu pas en privilégier un plus qu'un autre ?

  6. #6
    Membre éprouvé
    Avatar de SnakemaN
    Profil pro
    Bidouille-tout Android
    Inscrit en
    Juillet 2006
    Messages
    871
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Bidouille-tout Android

    Informations forums :
    Inscription : Juillet 2006
    Messages : 871
    Points : 1 118
    Points
    1 118
    Par défaut
    Citation Envoyé par Hugo69
    JE vais commencer par le second qui est plus leger:
    Oui oui je vois ca...

    C'est le signe d'un fou, qu'avoir honte d'apprendre
    Ubuntu 10.04 Lucid Lynx @home
    LE guide libre Linux & Ubuntu pour tous : Simple comme Ubuntu

  7. #7
    Membre régulier Avatar de hugo69
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    512
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2005
    Messages : 512
    Points : 122
    Points
    122
    Par défaut
    tout dabord emrci pour vos reponses.

    Ce sont deux mouseover qui mette 2 sortes d'affichage type ALT quand je passe au dessus d'un lien.

    JE juge que le travail est trop lourd pour ce que ca va raporter.

    Je pensais eventuellement que si on "appeler" diffrement chaque fichier dans le fichier html, on pourrait resoudre le pb.

    a partir du moment ou il faut s'attaquer au code, la manipulation me semble trop lourde, pour un simple mouseover, esthetique.

    Ainsi je vais en virer l'un des deux et tant pis.

    MErci pour vos reponses.

    Que dois je mettre sur le titre?
    je peux pas mettre resolu, "ABANDON peut etre?

  8. #8
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 289
    Points
    3 289
    Par défaut
    mdrr, ben c'est simple de combiner
    Tu mets ceci dans le code HTML :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <script>
    document.onmousemove=function(e) {
       e = (e?e:event)
       positiontip(e)
       MoveTip(e)
    }</script>
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  9. #9
    Membre régulier Avatar de hugo69
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    512
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2005
    Messages : 512
    Points : 122
    Points
    122
    Par défaut
    ca marche impeccable.

    Merci a toi.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Contenu javascript sur une page ajax
    Par 7804j dans le forum jQuery
    Réponses: 7
    Dernier message: 30/06/2011, 17h13
  2. mettre un scrollbars sur une page
    Par JCMANSION dans le forum ASP.NET
    Réponses: 3
    Dernier message: 12/10/2010, 21h28
  3. [Joomla!] debuter un nouveau site sur une page vierge
    Par sydaka dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 26/08/2010, 17h48
  4. désactiver un javascript sur une page
    Par Giantrick dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 28/11/2007, 09h11
  5. javascript sur une page creation flash mx
    Par hadjplasma dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 17/08/2005, 12h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo