views:

30

answers:

2

Hello,

I am working on dynamic page where height of the page is concern.

So, What I want is if height of <div id="a"> < 300px , Then only show new <div id="b">

How can I achieve this ?

Thanks.

  • Mandar
A: 

So far, what I understand, you more likely have to work that out with JavaScript.

if (document.getElementById('a').offsetHeight < 300) 
   document.getElementById('b').style.display = block;

don't forget to set b to display:none; as default

Josh
+1  A: 
<script type="text/javascript">
  $(document).ready(function(){
    if ($("#a").height()<300) {
      $("#b").show();
    }
  });
</script>
Gert G
@Gert G : Thanks. this worked perfect.
MANnDAaR