Created
June 30, 2014 10:15
-
-
Save stephenscaff/7fa8b7eaf4169175736a to your computer and use it in GitHub Desktop.
Find page url to add class
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(){ | |
| //If the url contains foo | |
| if (window.location.href.indexOf('foo') >= 0) { | |
| //add a class on specified div | |
| $('.myclass').addClass('myaddedclass') ; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment