在backbone中怎样在某个页面设置整个body的样式

在某一个页面中需要控制body的样式{overflow:hidden}为这个 这样写的this.$("body").css("overflow","hidden"); 如果直接获取body的某个样式,显示的是undefined
这是为什么

    xieyiClick : function(e) {

        var $checkbox = this.$("#checkbox-xieyi");

        if ($checkbox.prop("checked")) {

            this.error();

            this.$("#btn-register").removeAttr("disabled");

            this.$(".screen").css({"display":"block"});

            this.$("body").css("overflow","hidden");

            this.$(".user_book").css("display","block");


        } else {

            this.error("show", "请先仔细阅读注册协议并选择同意.");

            this.$("#btn-register").attr("disabled", "");

        }

    },

其实我只是在一个页面中设置body的样式为overflow:hiden 因为现在是点击出现一个弹框 同样我需要页面不能滑动

郎朗坤
浏览 692回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript