Created
March 11, 2013 19:31
-
-
Save mojaray2k/5136959 to your computer and use it in GitHub Desktop.
Here is a script to detect if there is a landscape or portrait img on a region of a webpage
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
//img-oreintation.js | |
$(document).ready(function () { | |
$('.two-column-content img').each(function () { | |
$(this).addClass(this.width > this.height ? 'landscape' : 'portrait'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment