当前位置:Gxlcms > JavaScript > jquery将标签元素的高设为屏幕的百分比

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

时间:2021-07-01 10:21:17 帮助过:4人阅读

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>

人气教程排行