首页 > 其他 > 详细

IScroll自动计算高度代码

时间:2019-12-07 13:03:39      阅读:105      评论:0      收藏:0      [点我收藏+]
setScrollHeight: function () {
        var temp_height = 0;
        temp_height = $("#" + this.wrapperId).height();
        try {
            var showHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - this.headAndBottomHeight;
            if (temp_height !== showHeight)
                temp_height = showHeight;
        }
        catch (e) { ; };
        $("#" + this.wrapperId).height(temp_height);
        if (!this.isNoData)//有数据
        {
            $("#" + this.scrollId).css("min-height", temp_height + 1);
            $("#" + this.scrollId).height("");
            $("#" + this.scrollId).height($("#" + this.scrollId).height()+20);
        } else {//无数据
            $("#" + this.scrollId).css("min-height", 0);
            $("#" + this.scrollId).height("");
        }
        if (this.myScroll === undefined || this.myScroll === null) this.loadedsroll();
        else this.myScroll.refresh();
    }

核心为红色部分,最后一句加20

IScroll自动计算高度代码

原文:https://www.cnblogs.com/zhaogaojian/p/12001117.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!