Created
July 16, 2019 12:50
-
-
Save jwarnox/72d12a99f9491dc06a4a7e6c07498020 to your computer and use it in GitHub Desktop.
Cookies.js sample
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
// GET COOKIE | |
var cookieTextSize = Cookies.get('theme-textsize'); | |
if (cookieTextSize) { | |
$('body').addClass('theme-textsize-' + cookieTextSize); | |
} | |
// SET COOKIE | |
$('.click-handler-for-text-size-bigger').on('click', function (e) { | |
Cookies.set('theme-textsize', 'bigger'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment