Jojoxx.net

 

 

AnvändareAnvändare
Besökare just nu: 82
SnabblänkarSnabblänkar
JavaScript-arkivet
Perl
FAQ
Sök på Jojoxx.netSök på Jojoxx.net



Länkmeny 6

Exempel


Kod


<br/>
<style type="text/css">
.menuA { font-size: 12px; font-family:Arial; color:black; background-color: rgb(200,220,255); padding:4px; }
.menuA_normal { padding:2px; padding-left:10px; padding-right:10px; }
.menuA_active { padding:1px; padding-left:9px; padding-right:9px; background-color: white; border:"solid gray 1px"; cursor:pointer; }
.menuA_disabled { padding:2px; padding-left:10px; padding-right:10px; }
</style>
<script type="text/javascript">
var menu=[
	{ text:"Google", url:"http://www.google.com", target:"_blank" },
	{ text:"Yahoo", url:"http://www.yahoo.com/", target:"_blank" },
	{ text:"|", disabled:true },
	{ text:"jojoxx.net", url:"http://www.jojoxx.net" },
	{ text:"Some old site", url:"http://www.domain.com", disabled:true },
	{ text:"webForum", url:"http://www.webforum.nu" }
]
var myMenu=new menuf("myMenu",menu);

function menuf(name,menuObj){
	this.menu=menuObj;
	this.desc=function(i){ window.status=(i!=null)?this.menu[i].url:""; return true; }
	this.selected=null;
	this.mclick=function(obj,n){
		if(this.selected&&this.selected!=obj){ this.selected.className="menuA_normal"; }
		this.selected=obj;
		window.open(this.menu[n].url,(this.menu[n].target)?this.menu[n].target:"_self");
	}
	this.wr=function(str){ document.write(str); }
	this.wr("<span class=\"menuA\">");
	for(var n in this.menu){
		if(this.menu[n].disabled){
			this.wr("<span class=\"menuA_disabled\" disabled=\"disabled\">");
		} else {
			this.wr("<span class=\"menuA_normal\" onclick=\""+name+".mclick(this,"+n+")\" onmouseover=\"if("+name+".selected!=this){ this.className='menuA_active' }; "+name+".desc("+n+");\" onmouseout=\"if("+name+".selected!=this){ this.className='menuA_normal' }; "+name+".desc();\">");
		}
		this.wr(this.menu[n].text=="|"?"<span style='width:3px;border:solid gray 1px;background-color:white;'></span>":this.menu[n].text); this.wr("</span>");
	}
	this.wr("</span>");
}
</script>


,