Last active
February 10, 2017 06:57
-
-
Save toddzebert/471ee65b8553878dc993b7484edd3d0b to your computer and use it in GitHub Desktop.
Sharing CSS breakpoints with JavaScript - Demo JavaScript
This file contains hidden or 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
$(function() { | |
bodyBP = bpExport.breakpoint('body'); | |
bodyBP.onChange(function(bp) { | |
$('.my-site-breakpoint').html(bp); | |
}); | |
myDivBP = bpExport.breakpoint('.my-div'); | |
myDivBP.onChange(function(bp) { | |
$('.my-div-breakpoint').html(bp); | |
}); | |
myDivBP.onChange(function(bp) { | |
if (bp === "just-right") { | |
$('.my-color-div').css('background-color', '#0000ff'); | |
} else { | |
$('.my-color-div').css('background-color', '#ff0000'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment