侧边栏全高

时间:2014-09-23 13:22:31

标签: css responsive-design

如何在不使用位置的情况下使我的侧边栏全屏高度:固定?我试过这个代码,但感觉不对。有什么建议吗?

JSFindle:http://jsfiddle.net/Pw4FN/57/

if($(window).height() > $('#page-container').height()){
    $('#menu').css("min-height", $(window).height());
}else{
    $('#menu').css("min-height", $('#page-container').height());
}

2 个答案:

答案 0 :(得分:1)

如果您希望div具有屏幕的完整高度:

#min-height {
    height: 100vh;
}

答案 1 :(得分:0)

您可以模拟表格:

https://jsfiddle.net/q7ch74Ly/

    function validatePhone() {
        var phone = document.getElementById("phone").value;

        var regex1 = /^(\+\d)?(\(|-)?\d{3}(\)|-)?\d{3}-?\d{4}$/;
        //match +1-800-123-45678, (555)123-4567, and so on
        if (!regex1.test(phone)){
            producePrompt("Error", "comment_phone_prompt");
            return false;
        }
        return true;//both sides should return
    }