https://github.com/sofish/proportion.js
meet the best proportion of the device.
https://github.com/sofish/proportion.js
Last synced: 3 months ago
JSON representation
meet the best proportion of the device.
- Host: GitHub
- URL: https://github.com/sofish/proportion.js
- Owner: sofish
- Created: 2015-04-23T09:21:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-27T17:11:54.000Z (over 11 years ago)
- Last Synced: 2025-01-02T03:45:00.166Z (over 1 year ago)
- Language: HTML
- Homepage: http://sofish.github.io/proportion.js
- Size: 124 KB
- Stars: 41
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## proportion.js
> meet the best proportion of the device.
### 一、api
```js
// ** 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](http://sofish.github.io/proportion.js)