Skip to content

Instantly share code, notes, and snippets.

@benheb
Created January 23, 2013 21:39
Show Gist options
  • Save benheb/4613841 to your computer and use it in GitHub Desktop.
Save benheb/4613841 to your computer and use it in GitHub Desktop.
var $window = $(window);
self.checkWidth = function(locate) {
var windowsize = $window.width();
if (windowsize < 500) {
self.is_mobile = true;
if (self.current_resort) {
$('.container').height(250);
$('#mobile_footer').show();
$('.mobile_name').show();
}
$('#new_footer').hide();
} else {
self.is_mobile = false;
$('.container').height('100%');
$('#mobile_footer').hide();
$('#new_footer').show();
$('.mobile_name').hide();
}
}
// Execute on load
self.checkWidth( true );
// Bind event listener
$(window).resize(self.checkWidth);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment