Created
June 11, 2012 19:15
-
-
Save andershaig/2912082 to your computer and use it in GitHub Desktop.
Add Page Classes
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 checkWidth() { | |
| var iframeWidth = $(window).width(); | |
| if (iframeWidth > 700) { | |
| $('body').addClass('is_timeline'); | |
| } else { | |
| $('body').removeClass('is_timeline'); | |
| } | |
| }; | |
| // Event listener for resize | |
| $(window).resize( function () { | |
| checkWidth(); | |
| }); | |
| // Call on load | |
| $(document).ready( function () { | |
| checkWidth(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment