Salve a tutti,
ho un problema,
mi trovo con un menu fatto interamente in Javascript.
Funziona tutto alla perfezione ma mi chiedo se posso fare in modo che quando clicco una voce nel menu e la pagina appare, sia possibile che questa voce rimanga di un colore diverso,
il famoso "current" in CSS, solamente che il mio menu é tutto in JS.
il codice che é presente in un file chiamato menu.js scritto qui di seguito.
Spero che aggiungendo qualcosa nel codice possa risolvere il mio problema,
grazie a tutti per l'aiuto.
var awmMenuName='menu';
var awmLibraryBuild=766;
var awmLibraryPath='/awmdata';
var awmImagesPath='/awmdata/menu';
var awmSupported=(navigator.appName + navigator.appVersion.substring(0,1)=="Netscape5" || document.all || document.layers || navigator.userAgent.indexOf('Opera')>-1 || navigator.userAgent.indexOf('Konqueror')>-1)?1:0;
if (awmAltUrl!='' && !awmSupported) window.location.replace(awmAltUrl);
if (awmSupported){
var nua=navigator.userAgent,scriptNo=(nua.indexOf('Chrome')>-1)?2:((nua.indexOf('Safari')>-1)?7:(nua.indexOf('Gecko')>-1)?2:((document.layers)?3:((nua.indexOf('Opera')>-1)?4:((nua.indexOf('Mac')>-1)?5:1))));
var mpi=document.location,xt="";
var mpa=mpi.protocol+"//"+mpi.host;
var mpi=mpi.protocol+"//"+mpi.host+mpi.pathname;
if(scriptNo==1){oBC=document.all.tags("BASE");if(oBC && oBC.length) if(oBC[0].href) mpi=oBC[0].href;}
while (mpi.search(/\\/)>-1) mpi=mpi.replace("\\","/");
mpi=mpi.substring(0,mpi.lastIndexOf("/")+1);
var e=document.getElementsByTagName("SCRIPT");
for (var i=0;i<e.length;i++){if (e*.src){if (e*.src.indexOf(awmMenuName+".js")!=-1){xt=e*.src.split("/");if (xt[xt.length-1]==awmMenuName+".js"){xt=e*.src.substring(0,e*.src.length-awmMenuName.length-3);if (e*.src.indexOf("://")!=-1){mpi=xt;}else{if(xt.substring(0,1)=="/")mpi=mpa+xt; else mpi+=xt;}}}}}
while (mpi.search(/\/\.\//)>-1) {mpi=mpi.replace("/./","/");}
var awmMenuPath=mpi.substring(0,mpi.length-1);
while (awmMenuPath.search("'")>-1) {awmMenuPath=awmMenuPath.replace("'","%27");}
document.write("<SCRIPT SRC='"+awmMenuPath+awmLibraryPath+"/awmlib"+scriptNo+".js'><\/SCRIPT>");
var n=null;
awmzindex=1000;
}
var awmImageName='';
var awmPosID='';
var awmSubmenusFrame='';
var awmSubmenusFrameOffset;
var awmOptimize=0;
var awmHash='';
var awmUseTrs=0;
var awmSepr=["0","","",""];
function awmBuildMenu(){
if (awmSupported){
awmCreateCSS(0,1,0,n,n,n,n,n,'none','0','#000000',0,0);
awmCreateCSS(1,2,0,'#FFFFFF',n,n,'bold 11px Arial, Helvetica, sans-serif',n,'none','0','#000000','7px 2px 7px 2',1);
awmCreateCSS(0,2,0,'#C00000',n,n,'bold 11px Arial, Helvetica, sans-serif',n,'none','0','#000000','7px 2px 7px 2',1);
awmCreateCSS(1,2,0,'#FFFFFF',n,n,'bold 11px Arial, Helvetica, sans-serif',n,'none','0','#000000','7px 2px 7px 2',0);
awmCreateCSS(0,2,0,'#C00000',n,n,'bold 11px Arial, Helvetica, sans-serif',n,'none','0','#000000','7px 2px 7px 2',0);
var s0=awmCreateMenu(0,0,0,0,1,0,0,0,0,10,10,0,0,0,2,1,0,n,n,100,1,0,0,0,0,-1,1,200,200,0,0,0,"0,0,0",n,n,n,n,n,n,n,n,0,0,0,0);
it=s0.addItem(1,2,2,"C H I S I A M O",n,n,"","chisiamo.html",n,n,n,"chisiamo.html",n,0,0,2,0,0);
it=s0.addItem(3,4,4," ",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"I L G A R D E N C E N T E R",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"I L V I V A I O",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"O G G E T T I D I D E S I G N",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"N U O V I A R R I V I",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"I N O S T R I G I A R D I N I",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"C O M E R A G G I U N G E R C I",n,n,"","",n,n,n,n,n,0,0,2,0,0);
it=s0.addItem(3,4,4,"C O N T A T T O",n,n,"","",n,n,n,n,n,0,0,2,0,0);
s0.pm.buildMenu();
}}