/proportion.js

meet the best proportion of the device.

Primary LanguageHTML

proportion.js

meet the best proportion of the device.

一、api

// ** Params
// @el: {Element} the element
// @isLanscape: [OPTIONAL] {Boolean} by default is `false`(portrait)
// @radio: [OPTIONAL] {Number}  the proportion of theShortSide/theLongSide,by default is `0.61`
// @maxWidth: [OPTIONAL] {Number} the max-width, by default is `640`
// @maxHeight: [OPTIONAL] {Number} the max-height, by default is `1008`

proportion(el, isLanscape, radio, maxWidth, maxHeight);

二、demo

http://sofish.github.io/proportion.js