Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2521 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  [JAVASCRIPT] Incompatible avec Netscape

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[JAVASCRIPT] Incompatible avec Netscape

n°782623
tomatogo
Posté le 30-06-2004 à 16:12:44  profilanswer
 

salut à tous !!!
 
Bon ba en fait tout est dit, g un JAVASCRIPT qui marche très bien sous IE mais qui ne fonctionne pas sous NETSCAPE et le reste.
 
voici l'adresse du site
http://www.eurosmart.fr
 
Bref je ne comprends pas d'ou ca vient.
 
voici le code :
 
<script language="JavaScript" type="text/javascript">
/* Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a> and modified by Michael van Ouwerkerk */
<!--
function lib_bwcheck() {
 this.ver=navigator.appVersion
 this.agent=navigator.userAgent
 this.dom=document.getElementById?1:0
 this.opera5=this.agent.indexOf("Opera 5" )>-1
 this.ie5=(this.ver.indexOf("MSIE 5" )>-1 && this.dom && !this.opera5)?1:0;  
 this.ie6=(this.ver.indexOf("MSIE 6" )>-1 && this.dom && !this.opera5)?1:0;
 this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
 this.ie=this.ie4||this.ie5||this.ie6
 this.mac=this.agent.indexOf("Mac" )>-1
 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;  
 this.ns4=(document.layers && !this.dom)?1:0;
 this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
 return this
}
var bw=new lib_bwcheck()
 
sLeft = 0         //distance bord gauche
sTop = 0        //distance bord sup
sMenuheight = 90  //hauteur
sArrowwidth = 34  //largeur flèches
sScrollspeed = 150 //vitesse défilement
sScrollPx = 20     //px par unit temps
sScrollExtra = 20 //vitesse 2 onmousedown
 
var tim = 0
var noScroll = true
function mLeft() {
 if (!noScroll && oMenu.x<sArrowwidth) {
  oMenu.moveBy(sScrollPx,0)
  tim = setTimeout("mLeft()",sScrollspeed)
 }
}
function mRight() {
 if (!noScroll && oMenu.x>-(oMenu.scrollWidth-(pageWidth))-sArrowwidth) {
  oMenu.moveBy(-sScrollPx,0)
  tim = setTimeout("mRight()",sScrollspeed)
 }
}
function noMove() {
 clearTimeout(tim);
 noScroll = true;
 sScrollPx = sScrollPxOriginal;
}
 
function makeObj(obj,nest,menu) {
 nest = (!nest) ? "":'document.'+nest+'.';
 this.elm = bw.ns4?eval(nest+"document.layers." +obj):bw.ie4?document.all[obj]:document.getElementById(obj);
    this.css = bw.ns4?this.elm:this.elm.style;
 this.scrollWidth = bw.ns4?this.css.document.width:this.elm.offsetWidth;
 this.x = bw.ns4?this.css.left:this.elm.offsetLeft;
 this.y = bw.ns4?this.css.top:this.elm.offsetTop;
 this.moveBy = b_moveBy;
 this.moveIt = b_moveIt;
 this.clipTo = b_clipTo;
 return this;
}
var px = bw.ns4||window.opera?"":"px";
function b_moveIt(x,y) {
 if (x!=null){this.x=x; this.css.left=this.x+px;}
 if (y!=null){this.y=y; this.css.top=this.y+px;}
}
function b_moveBy(x,y) {this.x=this.x+x; this.y=this.y+y; this.css.left=this.x+px; this.css.top=this.y+px;}
function b_clipTo(t,r,b,l){
 if(bw.ns4){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l;}
 else this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";
}
 
var sScrollPxOriginal = sScrollPx;
function sideInit() {
 //largeur du menu, généralement = largeur de la page. Sinon pageWidth=largeur désirée
 //pageWidth = (bw.ns4 || bw.ns6 || window.opera)?innerWidth:document.body.clientWidth;
 pageWidth=335;
 
 oBg = new makeObj('divBg')
 oMenu = new makeObj('divMenu','divBg',1)
 oArrowRight = new makeObj('divArrowRight','divBg')
 
 oBg.moveIt(sLeft,sTop)
 oMenu.moveIt(sArrowwidth,null)
 oArrowRight.css.width = sArrowwidth;
 oArrowRight.moveIt(pageWidth-sArrowwidth,null)
 
 if (!bw.ns4) oBg.css.overflow = "hidden";
 if (bw.ns6) oMenu.css.position = "relative";
 oBg.css.width = pageWidth+px;
 oBg.clipTo(0,pageWidth,sMenuheight,0)
 oBg.css.visibility = "visible";
}
 
if (bw.bw) onload = sideInit;
 
function cacheBulle() {
   infobulle.style.visibility="hidden";
}
 
function infoBulle(texte) {
 if (document.all) {
  infobulle.innerHTML='<b><font size=2 color=#ffffff style=Arial, Verdana, sans-serif>'+texte+'</font></b>';
  infobulle.style.visibility="visible";
 }
 if (document.layers) {
      document.layers["infobulle"].document.open();
      document.layers["infobulle"].document.write(texte);
      document.layers["infobulle"].document.close();
 }
}
//-->
</script>
 
et ensuite un pu plus loin g ça
 
<SCRIPT LANGUAGE="Javascript">
 
function styleCalque_<?php echo $produit; ?>(idCalque) {
  if (document.all) calqueStyle = document.all[idCalque].style;
  if (document.layers) calqueStyle = document.layers[idCalque];
  if (document.getElementById)  
    calqueStyle = document.getElementById(idCalque).style;
    return calqueStyle;
}
 
function deplaceCalque_<?php echo $produit; ?>(idCalque,posX,posY) {
  calqueStyle_<?php echo $produit; ?> = styleCalque_<?php echo $produit; ?>(idCalque);
  calqueStyle_<?php echo $produit; ?>.left = posX;
  calqueStyle_<?php echo $produit; ?>.top = posY;
}
 
function cacheBulle_<?php echo $produit; ?>() {
  styleCalque_<?php echo $produit; ?>("infobulle_<?php echo $produit; ?>" ).visibility = "hidden";
}
 
function infoBulle_<?php echo $produit; ?>(e,texte,classe) {
  if (document.all) deplaceCalque_<?php echo $produit; ?>('infobulle_<?php echo $produit; ?>',event.x,event.y);
  if ((document.layers) || ((document.getElementById) && (!document.all)))
    deplaceCalque_<?php echo $produit; ?>('infobulle_<?php echo $produit; ?>',e.pageX,e.pageY);
    base = "<TABLE><TR><TD CLASS='" + classe + "'>";
    fin = "</TD></TR></TABLE>";
  if (document.all) infobulle_<?php echo $produit; ?>.innerHTML = base + texte + fin;
  if (document.layers) {
    document.layers["infobulle_<?php echo $produit; ?>"].document.open();
    document.layers["infobulle_<?php echo $produit; ?>"].document.write(base + texte + fin);
    document.layers["infobulle_<?php echo $produit; ?>"].document.close();
}
 
if (document.getElementById) document.getElementById("infobulle_<?php echo $produit; ?>" ).innerHTML = base + texte + fin;
styleCalque_<?php echo $produit; ?>("infobulle_<?php echo $produit; ?>" ).visibility = "visible";
}
 
</SCRIPT>
 
alors sous IE c nikel et sous netscape ca ce casse la gueule.
Comprends pas pouvez vous m'aider SVP
MERCI d'avanace TOM-TOM :bounce:


Message édité par tomatogo le 30-06-2004 à 16:13:50
mood
Publicité
Posté le 30-06-2004 à 16:12:44  profilanswer
 

n°782660
tomatogo
Posté le 30-06-2004 à 16:51:17  profilanswer
 

il apparait que les problemes viendraent d'infobulle

n°783288
boulax
Inserer phrase hype en anglais
Posté le 01-07-2004 à 11:01:44  profilanswer
 

Ligne ? message d'erreur ?


---------------
Posté depuis des chiottes, sales. Me gusta.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  [JAVASCRIPT] Incompatible avec Netscape

 

Sujets relatifs
Récupérer via Javascript une propriété d'une class CSS non utilisé[javascript] Qu'est-ce que ne comprend pas ie ? [resolu]
[VB] Webbrowser et erreur javascript :/Javascript : quel livre conseillez vous pour s'y mettre ?
[javascript] Textbox expanderPB avec le OnMouseOut sur netscape 7.0 [Resolu]
[JAVASCRIPT] refresh d'une iframe dans un <div>Recupération d'un champ style "toto[1]" dans une fonction javascript
[Résolu][JavaScript]Copy to ClipBoard[Résolu][JavaScript]Probleme de Iframe + refresh
Plus de sujets relatifs à : [JAVASCRIPT] Incompatible avec Netscape


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR