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 :

cohabitation de 2 JS


Sujet :

JavaScript

  1. #1
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut cohabitation de 2 JS
    Bonjour à tous,
    Je dois vous prévenir que je suis passablement nouveau et même assez nul dans la création de sites web et des langages afférents.
    J'ai un problème de cohabitation de 2 scripts JS sur une même page.
    Ce sont
    1/ switcher.js (qui permet la permutation de 2 ou plusieurs feuilles de style pour des présentations différentes) et
    2/ thw.js qui permet la mobilité horizontale d'une page web (ex: http://www.thehorizontalway.com/).
    Je suis vraiment bloqué et ne sais comment résoudre le conflit de ces 2 scripts.
    Pouvez/voulez-vous m'aider, s'il vous plait ?
    Merci beaucoup

    PS: si nécessaire je pourrais vous exposer ici les 2 scripts antagonistes.




    MERCI à tous et à chacun. Vous avez été très patients.
    merci encore

  2. #2
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    sans doute des variables ou des fonctions qui portent le même nom ?

  3. #3
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut
    Citation Envoyé par SpaceFrog Voir le message
    sans doute des variables ou des fonctions qui portent le même nom ?
    Certes et merci de me répondre. Mais, comment régler ce conflit ?
    Si tu le veux, je peux te mettre ici les 2 JS.
    Merci encore

  4. #4
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    Il suffit de trouver les variables et ou fonctions et les renommer ...

  5. #5
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut
    Citation Envoyé par SpaceFrog Voir le message
    Il suffit de trouver les variables et ou fonctions et les renommer ...
    Merci du conseil. Avec ta réponse je suis bien avancé. Dans mon premier "post" j'avouais mon ignorance en tout langage informatique. Ton zèle et ton altruisme me font chaud au coeur mais la concision de tes réponses me laissent sur ma faim. J'ignore, à ma grande honte, ce que sont les variables ou les fonctions. Ne t'est-il pas possible d'être plus prolixe ou pédagogue pour éclairer ma lanterne ? Mais, peut être me suis-je fourvoyé. Je ne dois pas être sur le bon site. Je te prie donc de bien vouloir m'excuser d'avoir accaparé un temps qui doit t'être trop précieux puisque tu ne trouves pas le temps d'aider qqu'un qui ne te demande qu'un peu d'aide.
    S'il t'est loisible de me lire jusqu'au bout, je te souhaite une bonne soirée.

  6. #6
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    Je crains fort qu'il te manque vraiment les bases nécessaires si tu ne sais pas ce que sont des variables ou des fonctions ...

    pour les focntion c'est marqué devant :
    la syntaxe est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    function nomdefonction(){ .... }
    essaye de voir déja si tu vois deux fonctions portant le même nom ...
    genre init() ou load() un quelque chose comme ça.

    Pour les variables ça risque d'être un peu plus compliqué ...
    Passer au peigne fin deux librairies à la recherche de conflits peut s'avérer relativement fastidieux.
    J'ai tout de même un métier à coté et je ne suis que bénévole ...
    Tu comprendras que je ne suis pas là pour faire le travail de tout le monde, mais éventuellement pour donner des pistes et des informations.
    Tu peux toujours mettre le code ici en espérant que quelqu'un disposant d'un peu plus de temps que moi puisse résoudre ton problème.

  7. #7
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut conflit entre 2 JS
    OK ! Merci de ta réponse. Je mets ton conseil en pratique et voici les 2 scripts en conflit.
    le premier est styleswitcher ici:


    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
    function setActiveStyleSheet(title) {
      var i, a, main;
      for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
          a.disabled = true;
          if(a.getAttribute("title") == title) a.disabled = false;
        }
      }
    }
     
    function getActiveStyleSheet() {
      var i, a;
      for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
      }
      return null;
    }
     
    function getPreferredStyleSheet() {
      var i, a;
      for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        if(a.getAttribute("rel").indexOf("style") != -1
           && a.getAttribute("rel").indexOf("alt") == -1
           && a.getAttribute("title")
           ) return a.getAttribute("title");
      }
      return null;
    }
     
    function createCookie(name,value,days) {
      if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
      }
      else expires = "";
      document.cookie = name+"="+value+expires+"; path=/";
    }
     
    function readCookie(name) {
      var nameEQ = name + "=";
      var ca = document.cookie.split(';');
      for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
      }
      return null;
    }
     
    window.onload = function(e) {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
    }
     
    window.onunload = function(e) {
      var title = getActiveStyleSheet();
      createCookie("style", title, 365);
    }
     
    var cookie = readCookie("style");
    var title = cookie ? cookie : getPreferredStyleSheet();
    setActiveStyleSheet(title);
    le second, qui sert au scrolling horizontal de ma page ici :

    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
    226
    227
    228
    229
    230
    /* Horizontal Tiny Scrolling - a smooth scrolling script for horizontal websites
    (the brother of the vertical "Tiny Scrolling")
    by Marco Rosella - <a href="http://www.centralscrutinizer.it/en/design/js-php/horizontal-tiny-scrolling" target="_blank">http://www.centralscrutinizer.it/en/...tiny-scrolling</a>
                    v0.6 - February 14, 2007
     
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
     
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
     
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA				
    */
     
    window.onload = function() {
    	HtinyScrolling.init(); scrollTips.init();
    	}
     
    var HtinyScrolling = {
    	speed : 50,      //set here the scroll speed: when this value increase, the speed decrease. 
    	maxStep: 150,	 //set here the "uniform motion" step for long distances
    	brakeK: 3,		 //set here the coefficient of slowing down
    	hash:null,		
    	currentBlock:null,
    	requestedX:0,
    	init: function() {
    		var lnks = document.getElementsByTagName('a');   
    		for(var i = 0, lnk; lnk = lnks[i]; i++) {   
    			if ((lnk.href && lnk.href.indexOf('#') != -1) &&  ( (lnk.pathname == location.pathname) ||
    			('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {  
    			addEvent(lnk,'click',HtinyScrolling.initScroll,false);
    			lnk.onclick=function(){return false;} // Safari
    			}   
    		}    
    	},
    	getTarget: function(target) {
    		while(target.tagName.toLowerCase() != 'a')
    			target = target.parentNode;
    		return target;
    	},
    	getElementXpos: function(el){
    		var x = 0;
    		while(el.offsetParent){  
    			x += el.offsetLeft;    
    			el = el.offsetParent;
    		}	return x;
    	},		
    	getScrollLeft: function(){
    		if(document.all) return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
    		else return window.pageXOffset;   
    	},	
    	getWindowWidth: function(){
    		if (window.innerWidth)	return window.innerWidth; 
    		if(document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
    	},
    	getDocumentWidth: function(){
    		if (document.width) return document.width;
    		if(document.body.offsetWidth) return document.body.offsetWidth;
    	},
    	initScroll: function(e){
    		var targ;  
    		if (!e) var e = window.event;
    		if (e.target) targ = e.target;
    		else if (e.srcElement) targ = e.srcElement;  
    		targ = HtinyScrolling.getTarget(targ);  //a fix by Skid X
    		HtinyScrolling.hash = targ.href.substr(targ.href.indexOf('#')+1,targ.href.length); 
    		HtinyScrolling.currentBlock = document.getElementById(HtinyScrolling.hash);   
    		if(!HtinyScrolling.currentBlock) return;
    		HtinyScrolling.requestedX = HtinyScrolling.getElementXpos(HtinyScrolling.currentBlock); 
    		HtinyScrolling.scroll(targ); 
    		return false;
    	},
    	scroll: function(targ){
    		var left  = HtinyScrolling.getScrollLeft();
    		if(HtinyScrolling.requestedX > left) { 
    			var endDistance = Math.round((HtinyScrolling.getDocumentWidth() - (left + HtinyScrolling.getWindowWidth())) / HtinyScrolling.brakeK);
    			endDistance = Math.min(Math.round((HtinyScrolling.requestedX-left)/ HtinyScrolling.brakeK), endDistance);
    			var offset = Math.max(2, Math.min(endDistance, HtinyScrolling.maxStep));
    		} else { var offset = - Math.min(Math.abs(Math.round((HtinyScrolling.requestedX-left)/ HtinyScrolling.brakeK)), HtinyScrolling.maxStep);
    		} window.scrollTo(left + offset, 0);  
    		if(Math.abs(left-HtinyScrolling.requestedX) <= 1 || HtinyScrolling.getScrollLeft() == left) {
    			window.scrollTo(HtinyScrolling.requestedX, 0);
    			if(typeof XULDocument != 'undefined') {
    				location.hash = HtinyScrolling.hash;
    			}
     
    			//optional instructions: you can add an effect to enlight after the scroll the selected section.
    			//uncomment this line below if you want to change the opacity:
    			//mark.change_opacity(HtinyScrolling.hash);
     
    			//you can also call the function "mark.change_colors(HtinyScrolling.hash, fps, (duration in sec), #(color in hex), #(color in hex))" to change background color of selected section   
    			HtinyScrolling.hash = null;
    		} else 	setTimeout(HtinyScrolling.scroll,HtinyScrolling.speed);			
    	}
    }
     
    /* the mouse scrolling doesn't work with Opera, that hasn't a event associated to the mouse wheel */
     
    var scrollTips = {
    	dx : null,
    	init : function() {	
    		if (window.addEventListener) {
    		window.addEventListener("DOMMouseScroll", this.mouseScroll, false);
    		} else document.attachEvent("onmousewheel", this.mouseScroll); 
    		var left = document.getElementById('left');
    		addEvent(left,'mouseover', function() {this.dx=setInterval('scrollTips.arrowScroll(0)',100);return false;});
    		addEvent(left,'mouseout', function() { clearInterval(this.dx); return false;});
    		var right = document.getElementById('right');
    		addEvent(right,'mouseover', function() {this.dx=setInterval('scrollTips.arrowScroll(1)',100);return false;});
    		addEvent(right,'mouseout', function() { clearInterval(this.dx); return false;});
    	},
    	mouseScroll : function(e) {
    		if (!e) var e = window.event;
    		if (e.wheelDelta <= 0 || e.detail>=0){  
    		window.scrollBy(80,0);
    		} else  window.scrollBy(-80,0) ; 
    	},	
    	arrowScroll: function(val) {
    		if(val==1) {
    			window.scrollBy(70,0);
    		} else {
    			window.scrollBy(-70,0)
    		}
    	}
    }
     
    var mark = {        //first four functions are based on The Fade Anything Technique by Adam Michela 
    	valop : 100,
    	req : 0,
    	make_hex: function(r,g,b) {
    		r = r.toString(16); if (r.length == 1) r = '0' + r;
    		g = g.toString(16); if (g.length == 1) g = '0' + g;
    		b = b.toString(16); if (b.length == 1) b = '0' + b;
    		return "#" + r + g + b;
    	},
    	change_colors: function(id, fps, duration, from, to) {  
    		var frames = Math.round(fps * (duration / 1000));
    		var interval = duration / frames;
    		var delay = interval;
    		var frame = 0;		
    		if (from.length < 7) from += from.substr(1,3);
    		if (to.length < 7) to += to.substr(1,3);		
    		var rf = parseInt(from.substr(1,2),16);
    		var gf = parseInt(from.substr(3,2),16);
    		var bf = parseInt(from.substr(5,2),16);
    		var rt = parseInt(to.substr(1,2),16);
    		var gt = parseInt(to.substr(3,2),16);
    		var bt = parseInt(to.substr(5,2),16);		
    		var r,g,b,h;
    		while (frame < frames) {
    			r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));
    			g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));
    			b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));
    			h = this.make_hex(r,g,b); 		
    			setTimeout("mark.set_img_bgcolor('"+id+"','"+h+"')", delay);
    			frame++;
    			delay = interval * frame; 
    		}
    		setTimeout("mark.set_img_bgcolor('"+id+"','"+to+"')", delay);
    	},  
     
    	set_img_bgcolor: function(id, c) {   
    	    if(document.getElementById(id).getElementsByTagName('img')[0]) {
    		var o = document.getElementById(id).getElementsByTagName('img')[0];
    		o.style.backgroundColor = c;} else return;
    	},
    	get_img_bgcolor: function(id)  { 
    		var o = document.getElementById(id).getElementsByTagName('img')[0];
    		while(o) {
    			var c;
    			if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");
    			if (o.currentStyle) c = o.currentStyle.backgroundColor;
    			if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }
    			o = o.parentNode;
    		}
    		if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";
    		var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
    		if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));
    		return c;
    	},
    	change_opacity: function(el) {
    		if(!(/^menu/.test(el))) {
    			var post = document.getElementById(el);
    			if (mark.valop > 10 && mark.req == 0) {
    				mark.valop -= 10;
    				mark.set_opacity(post,mark.valop);
    				if(mark.valop == 10) {mark.req = 1};
    			} else 
    			if (mark.valop < 100 && mark.req == 1) {
    				mark.valop += 10;
    				mark.set_opacity(post,mark.valop);
    				if(mark.valop == 100) {mark.req = 2};
    			} 
    			if (mark.req != 2){
    			setTimeout("mark.change_opacity('"+el+"')", 50);
    			}
    			else { mark.set_opacity(post,9999); mark.req = 0; return;}
    		}
    	},
    	set_opacity: function(post,val){
    		post.style.opacity='0.' + val ;
    		post.style.filter="alpha(opacity=" + val + ")";
    	}
    }
     
    function addEvent( obj, type, fn ) {
    	if (obj.addEventListener)
    		obj.addEventListener( type, fn, false );
    	else if (obj.attachEvent) {
    		obj["e"+type+fn] = fn;
    		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
    		obj.attachEvent( "on"+type, obj[type+fn] );
    	}
    }
     
    function removeEvent( obj, type, fn ) {
    	if (obj.removeEventListener)
    		obj.removeEventListener( type, fn, false );
    	else if (obj.detachEvent) {
    		obj.detachEvent( "on"+type, obj[type+fn] );
    		obj[type+fn] = null;
    		obj["e"+type+fn] = null;
    	}
    }
    merci à ceux qui voudront bien m'aider.

  8. #8
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    Déja à ceux qui voudraient s'y pencher ...
    Il y a deux window.onload ...

  9. #9
    Membre éprouvé Avatar de laurentibus
    Inscrit en
    Mars 2008
    Messages
    875
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations forums :
    Inscription : Mars 2008
    Messages : 875
    Points : 908
    Points
    908
    Par défaut
    Je suis vraiment bloqué et ne sais comment résoudre le conflit de ces 2 scripts.
    Pouvez/voulez-vous m'aider, s'il vous plait ?
    un conseil :
    installe la web developper toolbar ...
    comme ça depuis ton exploreur tu pourra avoir un affichage de l erreur ....
    ensuite tu pourra nous la communiquer
    et enfin on pourra t'aider

  10. #10
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    je propserais plutot de sortir les deux woindow.onload pour en faire une fonction init

  11. #11
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut incompatibilité entre 2 JS
    Merci laurentibus. J'ai installé la toolbar dont tu me parlais mais cela n'a en rien résolu mon problème. Je ne comprends rien à cet outil étant, comme déjà dit absolument débutant.
    Apparemment, si 2 pointures comme vous sèchent sur mon problème, j'ai peu d'espoir de pouvoir en sortir.
    Pourtant, pour le peu que j'en sais, la solution de Spacefrog me semble une bonne piste. Mais voilà, arriverons-nous au bout de nos peines ???
    Merci de vos efforts et de votre temps

  12. #12
    Membre éprouvé Avatar de laurentibus
    Inscrit en
    Mars 2008
    Messages
    875
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations forums :
    Inscription : Mars 2008
    Messages : 875
    Points : 908
    Points
    908
    Par défaut


    Pour la web dev toolbar :
    regarde en haut a droite sur la même ligne que les onglets, tu as 3 icones ( compilation standard, CSS , et JS ) : donc nous c'est la 3eme qui nous intersse :
    donc elle est soit un V de couleur verte ( pas d erreur) soit un point d exclamation rouge (erreur !!!! )
    donc tu clique sur l icone et tu as tous les details .... a toi de nous dire

    Apparemment, si 2 pointures comme vous sèchent sur mon problème,
    c'est pas tant qu on sèche, perso j ai oublier ma boule de cristal chez moi ce matin ( en gros on est pas devin ... sans info on ne peut ou pas le temps de trouver .... )

    Pourtant, pour le peu que j'en sais, la solution de Spacefrog me semble une bonne piste
    pourquoi te semble ?? tu n as pas tester ??? tu attend quoi ??

    allez chui gentil :




    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    window.onload = function(e) {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
    }
     
    window.onunload = function(e) {
      var title = getActiveStyleSheet();
      createCookie("style", title, 365);
    }
    devient :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    window.onload=init();
    function init()
    {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
     
      var title = getActiveStyleSheet();
      createCookie("style", title, 365);
    }

  13. #13
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 663
    Points
    66 663
    Billets dans le blog
    1
    Par défaut
    Je ne séche pas ...
    je ne suis juste pas là pour faire ton code ...
    J'ai donné les indications ...

  14. #14
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Points : 91 220
    Points
    91 220
    Billets dans le blog
    20
    Par défaut
    Euhhh... Plutôt :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    function init()
    {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
     }
    En supprimant le window.onload, puis dans le 2nd script :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    window.onload = function() {
            init();
    	HtinyScrolling.init(); scrollTips.init();
    	}

  15. #15
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     function initScript1(e) {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
    }
     
    function initScript2() {
    	HtinyScrolling.init(); scrollTips.init();
    }
     
    window.onload = function(e) {
    initScript1(e);
    initScript2()
    }
    à mettre après les deux autres scripts



    ou
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     eval("window.onload")();
    entre les scripts (plus généralisé)

  16. #16
    Futur Membre du Club
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Points : 6
    Points
    6
    Par défaut Conflit entre 2 JS
    Merci Matthieu 2000.
    J'ai tenté les 2 formules. Seul le switcher fonctionne. Le scroll ne veut rien savoir.
    Ma parole, je vais devenir un cas d'école ....

  17. #17
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814
    Par défaut
    j'ai lu un peu ton code, il semble que tes scripts ne sont pas en conflits. Il se peut que se soit le style!

  18. #18
    Membre éprouvé Avatar de laurentibus
    Inscrit en
    Mars 2008
    Messages
    875
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations forums :
    Inscription : Mars 2008
    Messages : 875
    Points : 908
    Points
    908
    Par défaut
    galeazzo Web developper toolbar !!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

Discussions similaires

  1. Cohabitation INTERBASE 6 et FIREBIRD
    Par THV dans le forum Installation
    Réponses: 5
    Dernier message: 15/06/2005, 16h41
  2. [JVM]Faire cohabiter java 1.4 et 1.5
    Par MicroPuce dans le forum Général Java
    Réponses: 5
    Dernier message: 31/01/2005, 11h49
  3. Delphi 2005 et Delphi 7 cohabitent-ils ?
    Par vanquish dans le forum EDI
    Réponses: 5
    Dernier message: 15/12/2004, 21h50
  4. [CR6][CR8] cohabitation sur un même poste
    Par obi dans le forum SAP Crystal Reports
    Réponses: 8
    Dernier message: 27/11/2003, 20h24
  5. [Kylix] cohabitation
    Par jpaulin dans le forum EDI
    Réponses: 1
    Dernier message: 01/04/2003, 23h11

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