Hi
ist es irgendwie möglich die Transparenz eines Div Layers in % in CSS anzugeben?
Micronax
ist es irgendwie möglich die Transparenz eines Div Layers in % in CSS anzugeben?
Micronax
var browser_IE = (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ? true : false;
var browser_MOZ = (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) ? true : false;
dnd={
dragobj: null,
ox: 0,
oy: 0,
mx: 0,
my: 0,
init: function()
{
document.onmousemove=dnd.drag;
document.onmouseup=dnd.stop;
},
start: function(o)
{
o.style.zIndex++;
dnd.dragobj = o;
dnd.ox = dnd.mx - dnd.dragobj.offsetLeft;
dnd.oy = dnd.my - dnd.dragobj.offsetTop;
if ( browser_IE )
dnd.dragobj.style.filter = 'alpha(opacity=50);';
if ( browser_MOZ )
dnd.dragobj.style.opacity = .5;
},
drag: function(e)
{
e = (typeof(e) != 'object' || e == null ) ? window.event : e;
dnd.mx = (browser_IE) ? e.clientX : e.pageX;
dnd.my = (browser_IE) ? e.clientY : e.pageY;
if( typeof(dnd.dragobj) == 'object' && dnd.dragobj != null )
{
dnd.dragobj.style.left = (dnd.mx - dnd.ox) + "px";
dnd.dragobj.style.top = (dnd.my - dnd.oy) + "px";
}
},
stop: function()
{
if ( typeof(dnd.dragobj) != 'object' || dnd.dragobj == null )
return;
if ( browser_IE )
dnd.dragobj.style.filter = 'alpha(opacity=100);';
if ( browser_MOZ )
dnd.dragobj.style.opacity = 1;
dnd.dragobj=null;
}
}
<... onmousedown="dnd.start(this)" ..>
OffTopic:
Hatte jetzt keine Lust den Code zu formatieren, auf nem screen mit einer Auflösung von 1280x1024 sollte das gut zu lesen sein
Comment