Get help. Give help. A Web Design and Development Community.

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

  • # October 14, 2012 at 4:59 pm

    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 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.

    # October 14, 2012 at 5:30 pm

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

    # October 14, 2012 at 10:06 pm

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

    # February 15, 2016 at 9:52 am

    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)

You must be logged in to reply to this topic.

We have a pretty good* newsletter.