将标签元素的高设为屏幕的百分比

html部分:

<body>

<div id="margin_box"></div>

</body>

 

jquery部分:

<script>

     $(function(){
             var percent =0.15;
             $("#margin_box").css("height",window.document.body.clientHeight*percent)

     })

</script>

 

posted @ 2016-02-17 11:30  爱努力的小疯子  阅读(260)  评论(0编辑  收藏  举报