Last active
October 2, 2015 16:15
-
-
Save dbridgman/6a4ba8c34a13120a386d to your computer and use it in GitHub Desktop.
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
The if statement targets the URL | |
Add an ID to the target you want to add the class to, | |
Then enter it into the following line, alongside the name of the class you want: | |
"jQuery('#ID-NAME').addClass('CLASS-NAME');" | |
<!-- CODE TO USE IS BELOW --> | |
jQuery(function() { | |
var loc = window.location.href; // returns the full URL | |
if(/YOUR-URL/.test(loc)) { | |
jQuery('#ID-NAME').addClass('CLASS-NAME'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment