jQuery中outerWidth的方法介绍
来源:才华咖 本文已影响2.6W人
来源:才华咖 本文已影响2.6W人
本文实例讲述了jQuery中outerWidth()方法用法。分享给大家供大家参考。具体分析如下:
此方法获取第一个匹配元素外部宽度。
默认情况下外部高度是宽度(width)、内补白(padding)和边框(border)之和。
如果参数设置为true的话,外补白(margin)尺寸也会算入外部宽度。
此方法对可见和隐藏元素均有效。
可以与outerHeight()方法结合学习。
语法结构:
复制代码 代码如下:$(selector)rWidth(options)
参数列表:
参数 描述 options 定义是否把外补白(margin)计算在内:
一,外补白不计算在内,默认值。
二,外补白计算在内。
实例代码:
复制代码 代码如下:
div{
background-color:green;
height:100px;
width:200px;
padding:10px;
margin:10px;
border:5px solid red;
}
$(document)y(function(){
$("button")k(function(){
$("div")($("div")rWidth(true))
})
})
此处显outerWidth()数值
点击查看div的outerWidth
点击按钮可以显示div的`元素外部宽度。
希望本文所述对大家的jQuery程序设计有所帮助。
八年级Unit 5 What were you doing when the rainstorm came?教学设计
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
jQuery中使用了document和window哪些属性和方法小结
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
java.util.ArrayDeque类使用方法介绍
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
八年级上册英语期中考试知识点重点介绍Unit2Howoftendoyouexerci
关于javascript中encodeURI和decodeURI的使用方法
Unit 5 Whens your birthday?英语课后练习题
介绍信写作方法
Unit3Whatsyourfavouritefood第一课时教案
英语美文精选What is Your Recovery Rate
有关八年级上册英语复习要点:Unit2Howoftendoyouexercise
jQuery中outerWidth的方法介绍
How Do My Parents Feel About My Education英语作文
A Letter to the University President为题目的作文
Adjust Our Eyesight英语作文
自我介绍方法介绍
Fourth Thursday in November为题目的作文
初三年级英语课文复习 Unit 1. Try not to translate every word
Request timed out网卡的故障解决方法
Unit 1 How DO You Go There英语教后反思
What do you think of Internet初中英语作文
八年级上册Unit 1 How often do you exercise?教学设计
英语作文Adjust Our Attitude Towards Study
Unit 2 How often do you exercise教案
The Trees Outside my Window英语作文
Cultivate Your ReadingHabit培养阅读习惯方法
中学学习方法介绍
窗外的树The Trees Outside my Window大学英语作文
Unit 1 How DO You Go There英语教学反思
关于jQuery trigger()方法用法介绍