Visualizzazione dei risultati da 1 a 3 su 3

Discussione: problemi tra scripts

  1. #1

    problemi tra scripts

    Ciao a tutti,
    ho un problemino con 2 scripts.
    Praticamente ho uno script per il menu a tendina e uno script per uno slide immagini...
    ma c'è incompatibilità tra questi.
    Se inserisco lo slide..non mi funziona piu il menu..
    aiutatemi vi prego sto impazzendo!!!!!

    questo lo script dello slide:

    var photos=new Array()
    var text=new Array()
    var which=0
    var what=0

    photos[0]="images/brands/lgo_1.jpg"
    photos[1]="images/brands/lgo_2.jpg"
    photos[2]="images/brands/lgo_3.jpg"
    photos[3]="images/brands/lgo_4.jpg"
    photos[4]="images/brands/lgo_5.jpg"
    photos[5]="images/brands/lgo_6.jpg"
    photos[6]="images/brands/lgo_7.jpg"
    photos[7]="images/brands/lgo_8.jpg"
    photos[8]="images/brands/lgo_9.jpg"
    photos[9]="images/brands/lgo_10.jpg"
    photos[10]="images/brands/lgo_11.jpg"
    photos[11]="images/brands/lgo_12.jpg"
    photos[12]="images/brands/lgo_13.jpg"
    photos[13]="images/brands/lgo_14.jpg"
    photos[14]="images/brands/lgo_15.jpg"
    photos[15]="images/brands/lgo_16.jpg"
    photos[16]="images/brands/lgo_17.jpg"
    photos[17]="images/brands/lgo_18.jpg"
    photos[18]="images/brands/lgo_19.jpg"
    photos[19]="images/brands/lgo_20.jpg"
    photos[20]="images/brands/lgo_21.jpg"
    photos[21]="images/brands/lgo_22.jpg"

    text[-1]=""


    text[0]="testo da inserire"
    text[1]="testo da inserire"
    text[2]="testo da inserire"
    text[3]="testo da inserire"
    text[4]="testo da inserire"
    text[5]="testo da inserire"
    text[6]="testo da inserire"
    text[7]="testo da inserire"
    text[8]="testo da inserire"
    text[9]="testo da inserire"
    text[10]="testo da inserire"
    text[11]="testo da inserire"
    text[12]="testo da inserire"
    text[13]="testo da inserire"
    text[14]="testo da inserire"
    text[15]="testo da inserire"
    text[16]="testo da inserire"
    text[17]="testo da inserire"
    text[18]="testo da inserire"
    text[19]="testo da inserire"
    text[20]="testo da inserire"
    text[21]="testo da inserire"
    text[22]="testo da inserire"

    window.onload=new Function("document.getElementById('testo').innerHT ML=text[-1]")

    function backward(){
    if (which>0){
    window.status=''
    which--
    document.images.photoslider.src=photos[which];
    what--
    document.getElementById('testo').innerHTML = text[what];
    }
    }

    function forward(){
    if (which<photos.length-1){
    which++
    document.images.photoslider.src=photos[which]
    what++
    document.getElementById('testo').innerHTML = text[what];
    }
    else window.status='FINE!'
    }

    function type()
    {
    alert("Errore!")
    }


    -----------------------------------

    questo lo script del menu:

    var isDOM=document.getElementById?1:0,isIE=document.al l?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM? 1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;f unction getRef(i,p){p=!p?document.navigator?p.document;return isIE?p.all[i]:isDOM?(p.getElementById?p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=ge tSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn( 'x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.t op=p+px;else return parseInt(sty.top)');var aeOL=[];function addEvent(o,n,f,l){var a='addEventListener',h='on'+n,b='',s='';if(o[a]&&!l)return o[a](n,f,false);o._c|=0;if(o[h]){b='_f'+o._c++;o[b]=o[h]}s='_f'+o._c++;o[s]=f;o[h]=function(e){e=e||window.event;var r=true;if(b)r=o[b](e)!=false&&r;r=o[s](e)!=false&&r;return r};aeOL[aeOL.length]={o,h:h}};addEvent(window,'unload',function(){for(var i=0;i<aeOL.length;i++)with(aeOL[i]){o[h]=null;for(var c=0;o['_f'+c];c++)o['_f'+c]=null}});function FSMenu(myName,nested,cssProp,cssVis,cssHid){this.m yName=myName;this.nested=nested;this.cssProp=cssPr op;this.cssVis=cssVis;this.cssHid=cssHid;this.cssL itClass='';this.menus={root:new FSMenuNode('root',true,this)};this.menuToShow=[];this.mtsTimer=null;this.showDelay=0;this.switchDe lay=125;this.hideDelay=500;this.showOnClick=0;this .animations=[];this.animSpeed=100;if(isIE&&!isOp)addEvent(window ,'unload',new Function(myName+'=null'))};FSMenu.prototype.show=f unction(mN){with(this){menuToShow.length=arguments .length;for(var i=0;i<arguments.length;i++)menuToShow[i]=arguments[i];clearTimeout(mtsTimer);if(!nested)mtsTimer=setTim eout(myName+'.menus.root.over()',10)}};FSMenu.prot otype.hide=function(mN){with(this){clearTimeout(mt sTimer);if(menus[mN])menus[mN].out()}};function FSMenuNode(id,isRoot,obj){this.id=id;this.isRoot=i sRoot;this.obj=obj;this.lyr=this.child=this.par=th is.timer=this.visible=null;this.args=[];var node=this;this.over=function(evt){with(node)with(o bj){if(isNS4&&evt&&lyr.ref)lyr.ref.routeEvent(evt) ;clearTimeout(timer);clearTimeout(mtsTimer);if(!is Root&&!visible)node.show();if(menuToShow.length){v ar a=menuToShow,m=a[0];if(!menus[m]||!menus[m].lyr.ref)menus[m]=new FSMenuNode(m,false,obj);var c=menus[m];if(c==node){menuToShow.length=0;return}clearTimeo ut(c.timer);if(c!=child&&c.lyr.ref){c.args.length= a.length;for(var i=0;i<a.length;i++)c.args[i]=a[i];var delay=child?switchDelay:showDelay;c.timer=setTimeo ut('with('+myName+'){menus["'+c.id+'"].par=menus["'+node.id+'"];menus["'+c.id+'"].show()}',delay?delay:1)}menuToShow.length=0}if(!n ested&&par)par.over()}};this.out=function(evt){wit h(node)with(obj){if(isNS4&&evt&&lyr&&lyr.ref)lyr.r ef.routeEvent(evt);clearTimeout(timer);if(!isRoot) {timer=setTimeout(myName+'.menus["'+id+'"].hide()',hideDelay);if(!nested&&par)par.out()}}};i f(this.id!='root')with(this)with(lyr=getLyr(id))if (ref){if(isNS4)ref.captureEvents(Event.MOUSEOVER|E vent.MOUSEOUT);addEvent(ref,'mouseover',this.over) ;addEvent(ref,'mouseout',this.out);if(obj.nested){ addEvent(ref,'focus',this.over);addEvent(ref,'clic k',this.over);addEvent(ref,'blur',this.out)}}};FSM enuNode.prototype.show=function(){with(this)with(o bj){if(!lyr||!lyr.ref)return;if(par){if(par.child& &par.child!=this)par.child.hide();par.child=this}v ar offR=args[1],offX=args[2],offY=args[3],lX=0,lY=0,doX=''+offX!='undefined',doY=''+offY!=' undefined';if(self.page&&offR&&(doX||doY)){with(pa ge.elmPos(offR,par.lyr?par.lyr.ref:0))lX=x,lY=y;if (doX)lyr.x(lX+eval(offX));if(doY)lyr.y(lY+eval(off Y))}if(offR)lightParent(offR,1);visible=1;if(obj.o nshow)obj.onshow(id);setVis(1)}};FSMenuNode.protot ype.hide=function(){with(this)with(obj){if(!lyr||! lyr.ref)return;if(isNS4&&self.isMouseIn&&isMouseIn (lyr.ref))return show();if(args[1])lightParent(args[1],0);if(child)child.hide();if(par&&par.child==this) par.child=null;if(lyr){visible=0;if(obj.onhide)obj .onhide(id);setVis(0)}}};FSMenuNode.prototype.ligh tParent=function(elm,lit){with(this)with(obj){if(! cssLitClass||isNS4)return;if(lit)elm.className+=(e lm.className?' ':'')+cssLitClass;else elm.className=elm.className.replace(new RegExp('(\\s*'+cssLitClass+')+$'),'')}};FSMenuNode .prototype.setVis=function(sh){with(this)with(obj) {lyr.timer|=0;lyr.counter|=0;with(lyr){clearTimeou t(timer);if(sh&&!counter)sty[cssProp]=cssVis;if(isDOM&&animSpeed<100)for(var a=0;a<animations.length;a++)animations[a](ref,counter);counter+=animSpeed*(sh?1:-1);if(counter>100){counter=100}else if(counter<=0){counter=0;sty[cssProp]=cssHid}else if(isDOM)timer=setTimeout(myName+'.menus["'+id+'"].setVis('+sh+')',50)}}};FSMenu.prototype.activateM enu=function(id,subInd){with(this){if(!isDOM||!doc ument.documentElement)return;var a,ul,li,parUL,mRoot=getRef(id),nodes,count=1;if(is IE){var aNodes=mRoot.getElementsByTagName('a');for(var i=0;i<aNodes.length;i++){addEvent(aNodes[i],'focus',new Function('e','var node=this.parentNode;while(node){if(node.onfocus)s etTimeout(node.onfocus,1,e);node=node.parentNode}' ));addEvent(aNodes[i],'blur',new Function('e','var node=this.parentNode;while(node){if(node.onblur)no de.onblur(e);node=node.parentNode}'))}}var lists=mRoot.getElementsByTagName('ul');for(var i=0;i<lists.length;i++){li=ul=lists[i];while(li){if(li.nodeName.toLowerCase()=='li')brea k;li=li.parentNode}if(!li)continue;parUL=li;while( parUL){if(parUL.nodeName.toLowerCase()=='ul')break ;parUL=parUL.parentNode}a=null;for(var j=0;j<li.childNodes.length;j++)if(li.childNodes[j].nodeName.toLowerCase()=='a')a=li.childNodes[j];if(!a)continue;var menuID=myName+'-id-'+count++;if(ul.id)menuID=ul.id;else ul.setAttribute('id',menuID);var sOC=(showOnClick==1&&li.parentNode==mRoot)||(showO nClick==2);var eShow=new Function('with('+myName+'){var m=menus["'+menuID+'"],pM=menus["'+parUL.id+'"];'+(sOC?'if((pM&&pM.child)||(m&&m.visible))':'')+' show("'+menuID+'",this)}');var eHide=new Function(myName+'.hide("'+menuID+'")');addEvent(a, 'mouseover',eShow);addEvent(a,'focus',eShow);addEv ent(a,'mouseout',eHide);addEvent(a,'blur',eHide);i f(sOC)addEvent(a,'click',new Function('e',myName+'.show("'+menuID+'",this);if(e .cancelable&&e.preventDefault)e.preventDefault();e .returnValue=false;return false'));if(subInd)a.insertBefore(subInd.cloneNode (true),a.firstChild)}menus[id]=new FSMenuNode(id,true,this)}};if(!self.page)var page={win:self,minW:0,minH:0,MS:isIE&&!isOp};page. elmPos=function(e,p){var x=0,y=0,w=p?p:this.win;e=e?(e.substr?(isNS4?w.docu ment.anchors[e]:getRef(e,w)):e);if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.p ageX;y+=p.pageY}}if(e&&this.MS&&navigator.platform .indexOf('Mac')>-1&&e.tagName=='A'){e.onfocus=new Function('with(event){self.tmpX=clientX-offsetX;self.tmpY=clientY-offsetY}');e.focus();x=tmpX;y=tmpY;e.blur()}else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offset Parent}return{x:x,y:y}};if(isNS4){var fsmMouseX,fsmMouseY,fsmOR=self.onresize,nsWinW=inn erWidth,nsWinH=innerHeight;document.fsmMM=document .onmousemove;self.onresize=function(){if(fsmOR)fsm OR();if(nsWinW!=innerWidth||nsWinH!=innerHeight)lo cation.reload()};document.captureEvents(Event.MOUS EMOVE);document.onmousemove=function(e){fsmMouseX= e.pageX;fsmMouseY=e.pageY;return document.fsmMM?document.fsmMM(e):document.routeEve nt(e)};function isMouseIn(sty){with(sty)return((fsmMouseX>left)&&( fsmMouseX<left+clip.width)&&(fsmMouseY>top)&&(fsmM ouseY<top+clip.height))}}

  2. #2

    dimenticavo...

    ah dimenticavo....


    la incompatibilità sussiste solo su IE...su mozilla è tutto ok! come sempre....


    cmq la pagina in questione con i 2 script è la seguente:

    www.idemdesign.it/test/idem/brand.php



    vi prego...cercate di aiutarmi...sono rimasto bloccato...

  3. #3

    problema risolto

    ragazzi..ho risolto....non come avrei voluto..ma l'importante è che funge!

    ho caricato la pagina con lo script dello slide...non tramite l'INCLUDE ma tramite l'IFRAME...e ora IE me li fa partire entrambi...

    avrei preferito utilizzare INCLUDE..ma pazienza!

    ciaooooo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.