Hi,
My sctipt not work, it can't change opacity every 0.1 second!
i have alerted t, it didn't change black(the element) when it alerted(1-79), when var t was 80, it changed to opacity 0.8!, so where is 0.01-0.79???
Thanks.
My sctipt not work, it can't change opacity every 0.1 second!
Code:
function LiveSupport() {
var x = document.getElementById('c_cover');
var y = document.getElementById('c_popcontent');
var z;
var startOpacity = '0'; //int only
var endOpacity = '80'; //int only
var t = 0;
x.style.position = 'absolute';
x.style.top = '80px';
x.style.left = '50%';
x.style.marginLeft = '-325px';
x.style.background = '#000';
x.style.zIndex = '998';
x.style.height = '676px';
x.style.width = '650px';
x.style.opacity=startOpacity/100;
x.style.filter = "alpha(opacity=" + startOpacity + ")";
for (z=startOpacity; z!=endOpacity; z++) {
t++;
setTimeout(function () { setOpacity('c_cover', z); }, t+'0');
}
}
Thanks.
Comment