Last active
December 18, 2015 23:28
-
-
Save dibakarjana/5861327 to your computer and use it in GitHub Desktop.
jQuery Variable Height
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>jQuery Variable Height</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="col1"></div> | |
<div id="col2"></div> | |
<div id="sidebar">asdsd <br>asdasd</div> | |
</body> | |
</html> |
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
$(document).ready(function(){ | |
var sideheightnew = $('#sidebar').height(); | |
$('#col1').animate({height : sideheightnew}); | |
$('#col2').animate({height : sideheightnew}); | |
}); |
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
#col1{ | |
width:200px; | |
height:200px; | |
float:left; | |
background:#8cac50; | |
margin-right:10px; | |
} | |
#col2{ | |
width:200px; | |
height:1px; | |
float:left; | |
margin-right:10px; | |
background:#8cac50; | |
} | |
#sidebar{ | |
width:200px; | |
height:100px; | |
float:left; | |
margin-right:10px; | |
background:#2ec8f0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment