PHP速学视频免费教程(入门到精通)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
jquery中有三个获取element高度的方法,分别是:height(),innerheight(),outerheght(bool);同样对应的有三个获取element宽度的方法:width(),innerheight(),outerheight(bool),这三个方法分别对应怎样的元素属性,如下图所示:
从上面的图可以了解到:height()方法对应顶部style设置的width属性;
innerHeight()对应width+padding-top+padding-bottom;
outerHeight()对应width+padding-top+padding-bottom+border-top+border-bottom;
另外看到下面outerHeight与outerWidth的值不一样是由于outerWidth(bool)方法参数被设置成true,
这时会加上margin-top和margin-bottom;
即:outerWidth = width+padding-top+padding-bottom+border-top+border-bottom+margin-top+margin-bottom;
来个简单的示例吧
<script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("#id200").width("300px"); }); }); </script><div id="id100" style="background:yellow;height:100px;width:100px">HELLO</div> <div id="id200" style="background:yellow;height:100px;width:100px">W3SCHOOL</div> <button type="button">请点击这里</button>
以上所述就是本文的全部内容了,希望大家能够喜欢。
已抢7337个
抢已抢95475个
抢已抢14942个
抢已抢52732个
抢已抢195934个
抢已抢87512个
抢