Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Question about jQuery .height()

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #150230
    Rugg
    Participant

    Curious if anyone can suggest a way to write the following jQuery snippets using .height() instead of .css(‘height’)

    $('div').css({ 'height': (($(window).height())) + 'px' });
    
    $('div').css({ 'height': (($(window).height()) + 50) + 'px' });
    

    I attempted to accomplish this with the following syntax, but it doesn’t work…

    $('div').height($(window).height());
    
    $('div').height($(window).height() + 50);
    

    Any help is appreciated — thank you!

    #150233
    whatsoever
    Participant

    Is this relevant?
    http://jsfiddle.net/C3v5K/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.