height
スケーリングされた要素の実際の値を取得することは可能ですか?
transform: scale(...);
次のことを試しましたが、元に戻っていますheight
$('element').css('height'); // 16px (demo)
$('element').height(); // 21px (demo)
height
スケーリングされた要素の実際の値を取得することは可能ですか?
transform: scale(...);
次のことを試しましたが、元に戻っていますheight
$('element').css('height'); // 16px (demo)
$('element').height(); // 21px (demo)
以下のコードを使用して、スケーリングされた変換された要素の実際の高さを取得します。[ jsFiddle
]
「高さ」の代わりにユーザー「outerHeight」
//full code here
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
.button{
-webkit-transform: scale( 3 );
margin:100px;
display:block;
}
</style>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
$(document).ready(function($) {
$(window).load(function(){
alert($('.button').outerHeight()+ 'px');
alert($('.button').css('height'));
});
});
</script>
</head>
<body>
<button class="button">Welcome</button>
</body>
</html>