Adjust Div Size with jQuery

When working with background images, parallax websites, or full width and height sliders, you might find the need to have a div adjust to be the full width or height of the viewport automagically. This code will help you find your way. Sourced from the comments on

function resizeDiv() { 	
     vpw = $(window).width();
     vph = $(window).height(); 	
     $('.container_home').css({'100%': vph}); 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.