Let me start off by saying how much I love jQuery as a JavaScript library. It has made life so much easier, and I have been able to finish my work faster by using jQuery.
So today I found myself wishing that setting a minimum height to an element wasn’t so damned hard, and I finally realized how easy it could be. I thought I would share, since I obviously haven’t touched this site in a while.
Here’s how I did it:
First, I downloaded jQuery and the Dimensions plugin.
Then I added both scripts to my page:
<script type="text/javascript" src="path/to/jquery.js"></script>
<script type="text/javascript" src="path/to/dimensions.js"></script>
Then, using the dimensions plugin, I determined the height of my element, and created an if/then statement that says if the element has a height less than 200px, give that element a height of 200px.
<script type="text/javascript">
//<![CDATA[
$(function() {
var contentHeight = $('div#content').height();
if (contentHeight < 200) {
$('div#content').css('height','200px');
}
});
//]]>
</script>
It’s really that easy!
2 Comments at "Solving minimum height with jQuery."
PillSpot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.PillSpot.org. Vitamins@buy.online” rel=”nofollow”>.…
Categories: Mens Health.Antibiotics.Stomach.Weight Loss.Womens Health.Anti-allergic/Asthma.Skin Care.Pain Relief.Antiviral.Mental HealthStop SmokingEye Care.Antidepressants.Antidiabetic.Vitamins/Herbal Supplements.Anxiety/Sleep Aid.Blood Pressure/…
Buy:Zithromax.VPXL.Maxaman.Cialis.Viagra Super Active+.Viagra Professional.Propecia.Viagra.Viagra Soft Tabs.Cialis Soft Tabs.Viagra Super Force.Levitra.Cialis Professional.Super Active ED Pack.Soma.Cialis Super Active+.Tramadol….
Comment Now!