非常不错的一个javascript 类

2019-06-03 17:03:23王冬梅

                if(seHeight>s_h){
                    var newtop=(d_st<this.fixedHeight?0:d_st-this.fixedHeight-42);
                }
                else{
                // Thank you dron (http://www.ucren.com/)
                switch (d_st-this.oldScrolltop>0)
                    {
                    case true:
                        if (d_st-this.fixedHeight > s_t -seHeight){
                        var    newtop= d_st -this.fixedHeight - (s_h-seHeight)-68;
                        }
                    break;
                    case false:
                        if (d_st-this.fixedHeight<parseInt(sidebar.style.marginTop,10)){
                        var newtop= d_st-this.fixedHeight;
                        }
                    break;
                    }
                }
                this.oldScrolltop = d_st;
                if(newtop==undefined){ return;};