.innerWidth ()

· 8년 전 · 1700

.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,918
jQuery 8년 전 조회 1,995
jQuery 8년 전 조회 2,122
jQuery 8년 전 조회 2,292
jQuery 8년 전 조회 2,480
jQuery 8년 전 조회 2,726
jQuery 8년 전 조회 1,913
jQuery 8년 전 조회 2,891
jQuery 8년 전 조회 2,396
jQuery
[jQuery]
8년 전 조회 1,767
JavaScript 8년 전 조회 2,835
jQuery
[jQuery]
8년 전 조회 1,562
jQuery 8년 전 조회 1,797
jQuery 8년 전 조회 1,898
jQuery 8년 전 조회 1,701
jQuery 8년 전 조회 1,740
jQuery
[jQuery]
8년 전 조회 1,435
jQuery 8년 전 조회 2,047
jQuery 8년 전 조회 2,517
jQuery
[jQuery]
8년 전 조회 1,782
jQuery 8년 전 조회 1,476
jQuery
[jQuery]
8년 전 조회 1,921
jQuery 8년 전 조회 5,506
기타 8년 전 조회 3,251
jQuery
[jQuery]
8년 전 조회 1,627
jQuery 8년 전 조회 1,803
jQuery 8년 전 조회 1,909
PHP 8년 전 조회 5,226
node.js 8년 전 조회 4,235
jQuery 8년 전 조회 2,290