小勐拉维加斯国际数码图文有限公司 | | var $ = function(id) { return typeof id == 'string' ? document.getElementById(id) : id; } var flying = function(obj, w, h, callback) { var d = 10; var index = 0; var extend = 50; var step = { width: (w + extend) / d, height: (h + extend) / d, top: 30 / d }; var only; clearInterval(only); obj.style.display = 'block'; only = setInterval(function() { index++; obj.style.width = (index * step.width) + 'px'; obj.style.height = (index * step.height) + 'px'; obj.style.top = (index * step.top) + 'px'; obj.style.marginLeft = (0 - (index * step.width - 150)) / 2 + 'px'; if (index > d) { clearInterval(only); if (typeof callback == 'function') callback(obj); } }, 10); } var timer; $('enter').onmouseover = function() { clearTimeout(timer); timer = setTimeout(function() { if ($('all-links').style.display == 'none') { new flying($('flying'), 248, 293, function(obj) { $('all-links').style.display = 'block'; obj.style.display = 'none'; }); } }, 200); } $('enter').onmouseout = function() { clearTimeout(timer); timer = setTimeout(function() { $('all-links').style.display = 'none'; }, 200); } | | | | | | | | |