Forums

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

Home Forums JavaScript Make div responsive

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #167863
    jess888
    Participant

    Trying the make the div “mainlike” responsive so that it appears above the fold no matter the screen rez. So it would need to never be taller than the viewable screen.

    http://barbarawhiteperry.com/test.html

    The mainlike div is the grey box that contains the logo, menu and slideshow. The slideshow itself is already responsive.

    Thanks so much; really stressed today!

    #167868
    Paulie_D
    Member

    Since this will require JS to determine screen size I’ll push this over to the JS Jungle

    #167891
    dyr
    Participant

    Does not require js, just some fancy CSS3. :) I’ll respond with more detail after I wake up.

    #167892
    Paulie_D
    Member

    Does not require js, just some fancy CSS3.

    CSS can’t detect the height of the browser window and then proportion all the children as far as I know….but it’ll be interesting.

    #167893
    dyr
    Participant

    html, body { height: 100%; } + any children at height: 100%

    You can also use media queries with height, min-height, max-height. So yes you can use CSS to scale things to the browser window (height and width.)

    #167894
    Paulie_D
    Member

    Wouldn’t the footer be in the body?

    The requirement (as I understand it) is that only the “main” div is to be above the fold…the OP wants this be be as large as possible AND be above the fold.

    Nothing was said about any content / elements AFTER that…but perhaps I’m misunderstanding that these should be below the fold.

    However, I’ll be interested in this as I think it could be really useful if we can do it with pure CSS.

    #167895
    jess888
    Participant

    I think this is a viewport thing, after a bit of further research. I think the problem is the slideshow won’t get shorter unless the width gets narrower.

    I will keep trying, and report back if I solve it.

    MERCI!

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