This is a very simple & lightweight jQuery plugin which detects the orientation of an attributes you desire - and adds and appropriate class name ( Portrait, Landscape & Square).
Simply add the orientation.js file to the bottom of your file, and intialize the plugin on what ever images, divs or elements you desire. ( look at example below )
<script src="min/jquery.imageorientation.min.js"></script>
<script>
$(window).on('load', function() {
$('img').orientation();
});
</script>
I have included an index.html as page as an example if need be.
Any feedback is greatly apprciated.
_
__ _ __ _ __| |_ _ _ ___ _ _ __ _
/ _` / _` (_-| _| '_/ _ | ' \/ _` |
\__,_\__,_/__/\__|_| \___|_||_\__, |
|___/