Dynamically hiding an item if it doesnt fit in a DIV (alternative to Whitespace)

I thought his may be usefull for anyone wanting to use the whitespase fuctionality outside of its contraints.

jquery script:

if ($('#textBefore').height()+ $('#imageToHide').height() > $('#ContainingDiv').height()) {

$('#imageToHide').hide();

} else {

$('#imageToHide').show();

}

1 Like

This will surely be useful. Thank you.