Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function(){
$('.js_resize').each(function(){
var imageParent = $(this).parent();
var myWidth = $(this).width();
var myHeight = $(this).height();
var parentWidth = $(this).parent().width();
var parentHeight = $(this).parent().height();
var offset, ratio, newSide;
if (myWidth>myHeight) {
if ($(this).height()>parentHeight) {
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>