.innerWidth ()

· 8년 전 · 1815

.innerWidth ()

일치하는 요소 집합의 첫 번째 요소에 대해 현재 계산 된 내부 너비를 가져오고 (패딩을 포함하지만 테두리는 포함하지 않음) 일치하는 모든 요소의 내부 너비를 설정합니다.

예:
단락의 innerWidth를 돌려줍니다.


<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>innerWidth demo</title>
  <style>
  p {
    margin: 10px;
    padding: 5px;
    border: 2px solid #666;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<p>Hello</p>
<p></p>
 
<script>
var p = $( "p:first" );
$( "p:last" ).text( "innerWidth:" + p.innerWidth() );
</script>
 
</body>
</html>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
jQuery 8년 전 조회 2,042
jQuery 8년 전 조회 2,111
jQuery 8년 전 조회 2,258
jQuery 8년 전 조회 2,408
jQuery 8년 전 조회 2,621
jQuery 8년 전 조회 2,852
jQuery 8년 전 조회 2,044
jQuery 8년 전 조회 3,023
jQuery 8년 전 조회 2,524
jQuery
[jQuery]
8년 전 조회 1,886
JavaScript 8년 전 조회 2,964
jQuery
[jQuery]
8년 전 조회 1,693
jQuery 8년 전 조회 1,929
jQuery 8년 전 조회 2,028
jQuery 8년 전 조회 1,816
jQuery 8년 전 조회 1,875
jQuery
[jQuery]
8년 전 조회 1,563
jQuery 8년 전 조회 2,175
jQuery 8년 전 조회 2,643
jQuery
[jQuery]
8년 전 조회 1,913
jQuery 8년 전 조회 1,599
jQuery
[jQuery]
8년 전 조회 2,056
jQuery 8년 전 조회 5,633
기타 8년 전 조회 3,390
jQuery
[jQuery]
8년 전 조회 1,761
jQuery 8년 전 조회 1,933
jQuery 8년 전 조회 2,041
PHP 8년 전 조회 5,363
node.js 8년 전 조회 4,371
jQuery 8년 전 조회 2,418