最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

JS下拉缓冲菜单示例代码_javascript技巧

来源:动视网 责编:小采 时间:2020-11-27 21:13:20
文档

JS下拉缓冲菜单示例代码_javascript技巧

JS下拉缓冲菜单示例代码_javascript技巧: 代码如下: body,html,div,ul,li,span,img,a{ margin:0; padding:0; } a{ text-decoration:none; color:#000; font-weight:bold; width:150px; display:inline-block; text-align:center; } l
推荐度:
导读JS下拉缓冲菜单示例代码_javascript技巧: 代码如下: body,html,div,ul,li,span,img,a{ margin:0; padding:0; } a{ text-decoration:none; color:#000; font-weight:bold; width:150px; display:inline-block; text-align:center; } l
 代码如下:




JS下拉缓冲菜单_网页代码站()





  • 路飞

    草帽海贼团船长,特征是头戴草帽,天性乐观、热情、善良、天真、单纯。


  • 索隆

    草帽海贼团剑士,绿色头发,左耳戴三只黄色露珠耳环,绿色的肚兜,路痴。


  • 娜美

    精通气象学和航海术,擅长偷术、骗术、谈判及威胁恐吓,头脑聪明又机灵。


  • 山治

    草帽海贼团厨师,金发,有着卷曲眉毛,永远遮住半边脸的家伙,海贼中的绅士。




  • function kzxf_zoom(id)
    {
    this.initialize.apply(this, arguments)
    }

    kzxf_zoom.prototype =
    {
    initialize : function()

    {

    var _this = this;
    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]);

    };

    })(i)

    }

    },
    jump : function(obj1, obj2)

    {

    var _this = this;
    _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)
    {

    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;

    }

    }

    }

    };
    window.onload = function()
    {
    new kzxf_zoom('tab')

    };




    http://user.qzone.qq.com/1198772766


    文档

    JS下拉缓冲菜单示例代码_javascript技巧

    JS下拉缓冲菜单示例代码_javascript技巧: 代码如下: body,html,div,ul,li,span,img,a{ margin:0; padding:0; } a{ text-decoration:none; color:#000; font-weight:bold; width:150px; display:inline-block; text-align:center; } l
    推荐度:
    标签: 下拉菜单 菜单 js
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top