Benutzer:Moonboy/Kamelbau.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt.) |
|||
Zeile 1: | Zeile 1: | ||
// ================================================================ | // ================================================================ | ||
− | |||
− | |||
// ------ dock menu ------- | // ------ dock menu ------- | ||
// script by Gerard Ferrandez - Ge-1-doot - February 2006 | // script by Gerard Ferrandez - Ge-1-doot - February 2006 | ||
// http://www.dhteumeuleu.com | // http://www.dhteumeuleu.com | ||
+ | // modified by Moonboy - August 2008 (ov.lang) | ||
// ================================================================ | // ================================================================ | ||
Zeile 43: | Zeile 42: | ||
{ | { | ||
ovk=ov; | ovk=ov; | ||
− | document.getElementById("legend").innerHTML = ov.lang; | + | document.getElementById("legend").innerHTML = ov.getAttribute("ALT"); //= ov.lang; |
} | } | ||
if(M) W = Math.max((s*Math.cos(((pxLeft(o)+W/2)-xm)/sMax)),sMin); | if(M) W = Math.max((s*Math.cos(((pxLeft(o)+W/2)-xm)/sMax)),sMin); | ||
Zeile 75: | Zeile 74: | ||
setInterval("dock.run()", 16); | setInterval("dock.run()", 16); | ||
} | } | ||
+ | //-- |
Aktuelle Version vom 16. August 2008, 22:53 Uhr
// ================================================================
// ------ dock menu -------
// script by Gerard Ferrandez - Ge-1-doot - February 2006
// http://www.dhteumeuleu.com
// modified by Moonboy - August 2008 (ov.lang)
// ================================================================
var xm = xmb = ov = 0;
var M = true;
function dock(dock, sMin, sMax)
{
this.icons = document.getElementById(dock).getElementsByTagName('img');
this.N = this.icons.length;
this.s = sMin;
this.ovk = 0;
this.pxLeft = function(o)
{
for(var x=-document.documentElement.scrollLeft; o != null; o = o.offsetParent) x+=o.offsetLeft;
return x;
}
for(var i=0;i<this.N;i++)
{
with(this.icons[i])
{
style.width = sMin+"px";
style.height = sMin+"px";
className = "dockicon";
}
}
this.run = function()
{
with(this)
{
for(var i=0;i<N;i++)
{
var o = icons[i];
var W = parseInt(o.style.width);
if(ov && ov.className=="dockicon")
{
if(ov!=ovk)
{
ovk=ov;
document.getElementById("legend").innerHTML = ov.getAttribute("ALT"); //= ov.lang;
}
if(M) W = Math.max((s*Math.cos(((pxLeft(o)+W/2)-xm)/sMax)),sMin);
s = Math.min(sMax,s+1);
}
else
{
s = Math.max(s-1,sMin);
W = Math.max(W-N,sMin);
}
o.style.width = W+"px";
o.style.height = W+"px";
}
if(s >= sMax) M = false;
}
}
}
document.onmousemove = function(e)
{
if(window.event) e=window.event;
xm = (e.x || e.clientX);
if(xm!=xmb){
M = true;
xmb = xm;
}
ov = (e.target)?e.target:((e.srcElement)?e.srcElement:null);
}
window.onload = function()
{
dock = new dock("dock", 48, 128);
setInterval("dock.run()", 16);
}
//--