Created
October 20, 2012 13:09
-
-
Save jDramaix/3923235 to your computer and use it in GitHub Desktop.
Dimension calculation with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>GwtQuery</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js" type="text/javascript"></script> | |
<style> | |
.innerDiv{ | |
border: solid 1px black; | |
padding: 5px; | |
} | |
</style> | |
</head> | |
<body> | |
<div>An illustration how the jQuery works :</div> | |
<div id="view" style="display:none"> | |
<div class="innerDiv" style="width: 300px;"> | |
</div> | |
</div> | |
<p> | |
<div>innerDiv width: <span id="width"></span></div> | |
<div>innerDiv outerWidth: <span id="outerWidth"></span></div> | |
</p> | |
<script> | |
$("#width").text($(".innerDiv").width()); | |
$("#outerWidth").text($(".innerDiv").outerWidth()); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment