🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

maintainratio is a lightweight jQuery plugin which can be used to maintain the aspect ratio of an element (e.g. div) as the window resizes.

Aspect-Ratio Responsive

Documentation

jquery.maintainratio

JQuery Plug-in to maintain an aspect ratio of an element as it resizes

Demo available here: MaintainRatio JQuery Plugin.

Example use(s):

JQUERY:

$( document ).ready(function() {  	$('.photo-square').maintainRatio({ 	    ratio: 1  	});  	$('.photo-portrait').maintainRatio({ 	    ratio: 1.5   	});  	$('.photo-landscape').maintainRatio({ 	    ratio: 0.5   	});  }); 

You May Also Like