|
|
|
| Написал такое, но испугался когда не сработало в 6 ие..
Именно с дивом. Другие теги пробовал всё ок.
Даже просто в стиле "filter:alpha(opacity=100);" не работает О_о
Выложил страницу как есть, проверьте пожалуйста, возможно мой ие обиделся за чтото на меня :))
<html>
<head>
<script type="text/javascript" language="javascript">
Array.prototype.in_array = function(item) {
for(var i in this) if(this[i] === item) return true;
return false;
};
Array.prototype.key = function(item) {
for(var i in this) if(this[i] === item) return i;
return false;
};
function isOld() { return typeof window.external=='object' && typeof document.all=='object' ? true : false }
// fade ### 0 - in, 1 - out ### //
var fade = {
c: {s: 1, t: 30},
s: [],
o: [],
t: [],
io: isOld(),
m: function(k, m) {
var s = m == 0 ? this.s[k] += this.c['s'] : this.s[k] -= this.c['s'];
with(this.o[k].style) {
this.io ? filter = 'alpha(opacity=' + s * 10 + ')'
: opacity = s / 10;
}
if(s <= 0 || s >=10) {
this.s[k] = m == 0 ? 10 : 0;
return;
}
this.t[k] = setTimeout( function(){ fade.m(k, m) }, this.c['t']);
},
go: function(o, m) {
if(!o) return;
var k;
if(this.o.in_array(o)) {
k = this.o.key(o);
clearTimeout(this.t[k]);
}
else {
k = this.o.length;
this.s[k] = m * 10;
this.o[k] = o;
this.t[k] = null;
}
this.m(k, m);
}
}
</script>
</head>
<body>
<div style="padding: 20px; border: 1px solid black; filter:alpha(opacity=100);" id="div">xxxxxxxxx</div>
<div style="padding: 20px; border: 1px solid black; opacity:0" id="div2">xxxxxxxxx</div>
<a href="#" onmouseout="fade.go(document.getElementById('div'), 1)" onmouseover="fade.go(document.getElementById('div'), 0)">
[____________div_____________]
</a>
<a href="#" onmouseout="fade.go(document.getElementById('div2'), 1)" onmouseover="fade.go(document.getElementById('div2'), 0)">
[____________div2_____________]
</a>
</body>
</html>
|
| |
|
|
|
|
|
|
|
для: sl1p
(17.02.2009 в 05:02)
| | Хух, нашёл слава богу в сети, filter:alpha(opacity) не работает с дивами с неопределённой шириной. | |
|
|
|