Last active
December 20, 2015 03:49
-
-
Save JGallardo/6066028 to your computer and use it in GitHub Desktop.
Things that I have to nest for various cases for this responsive site.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------------- | |
Global | |
----------------------------------------- */ | |
$(window).load(checkWindowSize); | |
$(window).resize(checkWindowSize); | |
/* | |
function checkWindowSize() { | |
if ( $(window).width() < 380 ) { | |
$('div#footer ul li').addClass('button medium secondary expanded'); | |
} | |
else { | |
$('div#footer ul li').removeClass('button medium secondary expanded'); | |
} | |
} | |
*/ | |
/* ----------------------------------------- | |
Home Page - shipping.aspx | |
----------------------------------------- */ | |
$('div#homelinks div').addClass('panel'); | |
function checkWindowSize() { | |
if ( $(window).width() < 1200 ) { | |
$('div.responsiveContainer').addClass('row'); | |
$('#homelinks div.panel:not(:last-child)').addClass('large-4 small-11 columns'); | |
$('#homelinks div.panel:last-child').addClass('small-11 columns'); | |
} | |
else { | |
$('div.responsiveContainer').removeClass('row'); | |
$('#homelinks div.panel:not(:last-child)').removeClass('large-4 small-11 columns'); | |
$('#homelinks div.panel:last-child').removeClass('small-11 columns'); | |
} | |
} | |
/* ----------------------------------------- | |
Shipping Page - shipping.aspx | |
----------------------------------------- */ | |
/* | |
function checkWindowSize() { | |
if ( $(window).width() < 380 ) { | |
$('span.shippingPhone').addClass('block'); | |
} | |
else { | |
$('span.shippingPhone').removeClass('block'); | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an optimized version of
checkWindowSize
, assuming thatdiv.responsiveContainer
always refer to the same elements: