亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery中innerHeight()方法用法實(shí)例

 更新時(shí)間:2015年01月19日 08:49:08   投稿:shichen2014  
這篇文章主要介紹了jQuery中innerHeight()方法用法,實(shí)例分析了innerHeight()方法的功能、定義及獲取第一個(gè)匹配元素內(nèi)部區(qū)域高度的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery中innerHeight()方法用法。分享給大家供大家參考。具體分析如下:

獲取第一個(gè)匹配元素內(nèi)部區(qū)域高度。
包括內(nèi)補(bǔ)白(padding)、不包括邊框border)。
也就是說內(nèi)部區(qū)域的寬度等于width和padding之和。
此方法對(duì)可見和隱藏元素均有效。
可以結(jié)合innerWidth()方法學(xué)習(xí)。

語法結(jié)構(gòu):

復(fù)制代碼 代碼如下:
$(selector).innerHeight()

實(shí)例代碼:

復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://chabaoo.cn/" />
<title>腳本之家</title>
<style type="text/css">
p{
  background-color:green;
  height:100px;
  width:200px;
  padding:10px;
  border:5px solid red;
}
</style>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("p").text($("p").innerHeight())
  });
});
</script>
</head>
<body>
<p>此處顯示innerHeight數(shù)值</p>
<button>點(diǎn)擊查看p的innerHeight</button>
</body>
</html>

上面的代碼可以將元素的內(nèi)部區(qū)域的高度寫入p元素中。

希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論