.innerWidth ()

· 8년 전 · 1671

.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년 전 조회 1,874
jQuery 8년 전 조회 1,958
jQuery 8년 전 조회 2,080
jQuery 8년 전 조회 2,255
jQuery 8년 전 조회 2,442
jQuery 8년 전 조회 2,695
jQuery 8년 전 조회 1,871
jQuery 8년 전 조회 2,845
jQuery 8년 전 조회 2,357
jQuery
[jQuery]
8년 전 조회 1,728
JavaScript 8년 전 조회 2,795
jQuery
[jQuery]
8년 전 조회 1,528
jQuery 8년 전 조회 1,770
jQuery 8년 전 조회 1,866
jQuery 8년 전 조회 1,672
jQuery 8년 전 조회 1,704
jQuery
[jQuery]
8년 전 조회 1,386
jQuery 8년 전 조회 2,013
jQuery 8년 전 조회 2,473
jQuery
[jQuery]
8년 전 조회 1,748
jQuery 8년 전 조회 1,453
jQuery
[jQuery]
8년 전 조회 1,893
jQuery 8년 전 조회 5,469
기타 8년 전 조회 3,219
jQuery
[jQuery]
8년 전 조회 1,596
jQuery 8년 전 조회 1,765
jQuery 8년 전 조회 1,868
PHP 8년 전 조회 5,196
node.js 8년 전 조회 4,194
jQuery 8년 전 조회 2,256
🐛 버그신고