Grow your CSS skills. Land your dream job.

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

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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".