In the below code, there's the "initialHeight" property which has a fixed value of 222. The problem is, the website is designed responsively, so I need to have different values for "initialHeight" depending on the screen resolution. So if possible I need to have the script read the height from whatever I specify in the CSS.
Here's the current code:
<script type="text/javascript">
$().ready(function() {
$("div.more-block").divgrow({
initialHeight: 222
});
});
</script>
So I'd like to have something like....
<style type="text/css">
.height {height:250px}
@media screen and (max-width: 1440px) {
.height {height:210px}
}
@media screen and (max-width: 1200px) {
.height {height:150px}
}
</style>
<script type="text/javascript">
$().ready(function() {
$("div.more-block").divgrow({
initialHeight: (css height style from .height)
});
});
</script>
Is that possible somehow?
initialHeight: $("div.more-block").height()?divgrow()the div if it already had the right height. @user1610904 what doesdivgrow()does exactly?