|
|
|
| скажите пожалуйста, почему данный код не работает в IE??
var z;
var browser = (navigator.userAgent.indexOf ('MSIE') >= 0);
function tst(x,x2,obj) // x - конечное значение прозрачности, x2 - начальное
{
var t,t2;
this.appear = function() {
var op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
if(op < x) {
clearTimeout(t2);
op = op + 0.05;
alert(op);
if (browser) obj.style.filter = 'alpha(opacity='+op*100+')';
else obj.style.opacity = op;
t = setTimeout(arguments.callee,50);
}
}
this.disappear = function() {
var op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
if(op > x2) {
clearTimeout(t);
op = op - 0.05;
alert(op);
if (browser) obj.style.filter = 'alpha(opacity='+op*100+')';
else obj.style.opacity = op;
t2 = setTimeout(arguments.callee,50);
}
}
}
|
| |
|
|