kzxf_zoom.prototype =
{
initialize : function()
{
var _this = this; { }; { }; })(i) } }, { var _this = this; var iCur = parseFloat(_this.css(obj, proper)); proper == 'opacity' && (iCur = parseInt(iCur.toFixed(2) * 100)); var iSpeed = (oAttr[proper] - iCur) / 5; iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); if(iCur != oAttr[proper]) { bStop = false; _this.css(obj, proper, iCur + iSpeed); } } if(bStop) { clearInterval(obj.timer); fnCallBack && fnCallBack.apply(_this, arguments); } },20); }, css : function(obj, attr, value) { if(arguments.length == 2) { return obj.currentStyle ? obj.currentStyle[attr] : getComputedStyle(obj, null)[attr] } if(arguments.length == 3) { switch(attr) { case 'width' : case 'height' : case 'top' : case 'bottom' : case 'left' : case 'marginLeft': case 'marginTop': obj.style[attr] = value + 'px'; break; case 'opacity' : obj.style.filter = 'alpha(opacity = '+value+' )'; obj.style.opacity = value / 100; break; default : obj.style[attr] = value; break; } } } }; }; script>
this.wrapBox = document.getElementById('tab');
this.oLi = this.wrapBox.getElementsByTagName('li');
this.aImg = this.wrapBox.getElementsByTagName('img');
this.content = this.wrapBox.getElementsByTagName('span');
for(var i=0;i
(function(i){
_this.oLi[i].onmouseover = function()
_this.jump(_this.aImg[i], _this.content[i]);
_this.oLi[i].onmouseout = function()
_this.hidden(_this.aImg[i], _this.content[i]);
jump : function(obj1, obj2)
_this.animation(obj1, {height:130, width:160, marginLeft:-78, marginTop:-128},function(){
_this.animation(obj1, {height:115, width:140, marginLeft:-70, marginTop:-115}, function(){
_this.animation(obj1, {height:120, width:150, marginLeft:-75, marginTop:-120})
})
});
_this.animation(obj2, {height:200});
},
hidden : function(obj1, obj2)
{
var _this = this;
_this.animation(obj1, {width:0, height:0, marginLeft:0, marginTop:0});
_this.animation(obj2, {height:0});
},
animation : function(obj, oAttr, fnCallBack)
{
var _this = this;
clearInterval(obj.timer);
obj.timer = setInterval(function()
{
var bStop = true;
for(proper in oAttr)
{
window.onload = function()
{
new kzxf_zoom('tab')
http://user.qzone.qq.com/1198772766