Forums

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

Home Forums JavaScript jQuery Window Resize (do this when window is resized to this width)

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40288
    uddinnyc94
    Member

    Hi, Okay first off if you are here then I am assuming that you know about responsive web design. Also you know about CSS3 media queries. Okay so here is what I want to do when the browser/window is resized to less then 700 pixels I want following things to happen

    you know jquery append other usual stuff.

    but the thing is It just won’t work. I tried a snippet that css-tricks.com provided in an article years back but had no success with it.

    In simple terms when the window/browser is lower then 700 then I want to do other things with jquery.

    #111831
    Senff
    Participant

    window.onresize = function(event) {
    viewportwidth = $(window).width();
    if (viewportwidth<700) {
    // some jquery stuff here;
    }
    }

    #111844
    uddinnyc94
    Member

    Thanks for the quick reply. I will try it out as soon as I can.

    #238044
    claytonzaugg
    Participant

    Thank you very much for this great solution! Found this to be helpful in my situation.

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