ciao,
ho 2 script che sembrerebbero in conflitto.
uno o meglio sarebbero 2, funzionano per arrotondare gli angoli dei nifty corners, il terzo per aprire le immagini in una finestra che si autodimensiona in base all'immagine.
Che non funziona quando sono attivi entrambi nell'header è quello per le immagini. Mi da "errore nella visualizzazione della pagina" e riguarda IE, mentre con FF no problem.
mi sapreste dire qualcosa su come evitare questo problema?
vi posto i codici:
nifty corners:
secondo nifty cornerscodice:function NiftyCheck(){ if(!document.getElementById || !document.createElement) return(false); var b=navigator.userAgent.toLowerCase(); if(b.indexOf("msie 5")>0 && b.indexOf("opera")==-1) return(false); return(true); } function Rounded(selector,bk,color,size){ var i; var v=getElementsBySelector(selector); var l=v.length; for(i=0;i<l;i++){ AddTop(v[i],bk,color,size); AddBottom(v[i],bk,color,size); } } function RoundedTop(selector,bk,color,size){ var i; var v=getElementsBySelector(selector); for(i=0;i<v.length;i++) AddTop(v[i],bk,color,size); } function RoundedBottom(selector,bk,color,size){ var i; var v=getElementsBySelector(selector); for(i=0;i<v.length;i++) AddBottom(v[i],bk,color,size); } function AddTop(el,bk,color,size){ var i; var d=document.createElement("b"); var cn="r"; var lim=4; if(size && size=="small"){ cn="rs"; lim=2} d.className="rtop"; d.style.backgroundColor=bk; for(i=1;i<=lim;i++){ var x=document.createElement("b"); x.className=cn + i; x.style.backgroundColor=color; d.appendChild(x); } el.insertBefore(d,el.firstChild); } function AddBottom(el,bk,color,size){ var i; var d=document.createElement("b"); var cn="r"; var lim=4; if(size && size=="small"){ cn="rs"; lim=2} d.className="rbottom"; d.style.backgroundColor=bk; for(i=lim;i>0;i--){ var x=document.createElement("b"); x.className=cn + i; x.style.backgroundColor=color; d.appendChild(x); } el.appendChild(d,el.firstChild); } function getElementsBySelector(selector){ var i; var s=[]; var selid=""; var selclass=""; var tag=selector; var objlist=[]; if(selector.indexOf(" ")>0){ //descendant selector like "tag#id tag" s=selector.split(" "); var fs=s[0].split("#"); if(fs.length==1) return(objlist); return(document.getElementById(fs[1]).getElementsByTagName(s[1])); } if(selector.indexOf("#")>0){ //id selector like "tag#id" s=selector.split("#"); tag=s[0]; selid=s[1]; } if(selid!=""){ objlist.push(document.getElementById(selid)); return(objlist); } if(selector.indexOf(".")>0){ //class selector like "tag.class" s=selector.split("."); tag=s[0]; selclass=s[1]; } var v=document.getElementsByTagName(tag); // tag selector like "tag" if(selclass=="") return(v); for(i=0;i<v.length;i++){ if(v[i].className==selclass){ objlist.push(v[i]); } } return(objlist); }
script per le immaginicodice:window.onload=function(){ if(!NiftyCheck()) return; RoundedTop("div#container","#FFF","#e7e7e7"); RoundedBottom("div#container","#FFF","#8395CB"); RoundedTop("ul#nav li","transparent","#C0CDF2"); Rounded("div#box","#C0CDF2","#E4E7F2"); Rounded("div#minipics li","#C0CDF2","#FFF"); RoundedTop("div.gradient","#C0CDF2","#B8B8B8"); RoundedBottom("div.gradient","#C0CDF2","#ECECF2"); Rounded("p.sfondo","#FFF","#FFF"); }
ho finitocodice:// Set the horizontal and vertical position for the popup PositionX = 100; PositionY = 100; // Set these value approximately 20 pixels greater than the // size of the largest image to be used (needed for Netscape) defaultWidth = 500; defaultHeight = 500; // Set autoclose true to have the window close automatically // Set autoclose false to allow multiple popup windows var AutoClose = true; // Do not edit below this line... // ================================ if (parseInt(navigator.appVersion.charAt(0))>=4){ var isNN=(navigator.appName=="Netscape")?1:0; var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;} var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY; var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY; function popImage(imageURL,imageTitle){ if (isNN){imgWin=window.open('about:blank','',optNN);} if (isIE){imgWin=window.open('about:blank','',optIE);} with (imgWin.document){ writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>'); writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){'); writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}'); writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);'); writeln('width=100-(document.body.clientWidth-document.images[0].width);'); writeln('height=100-(document.body.clientHeight-document.images[0].height);'); writeln('window.resizeTo(width,height);}');writeln('if (isNN){'); writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}'); writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>'); if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">') else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">'); writeln('[img]+imageURL+[/img]</body></html>'); close(); }}![]()
grazie di cuore!

Rispondi quotando
p
