Home › Forums › JavaScript › Changing something based on the browser window width › Re: Changing something based on the browser window width
December 9, 2009 at 8:59 am
#67896
Member
You might want to add this in case the browser is resized.
Code:
// On Resize
$(window).resize(function() {
if( $(this).width() < 900 ) { console.log("Less"); }else { console.log("More"); } });
$(window).resize(function() {
if( $(this).width() < 900 ) { console.log("Less"); }else { console.log("More"); } });