https://github.com/tategakibunko/jquery.image-size-assign
Force set width and height to all image tags.
https://github.com/tategakibunko/jquery.image-size-assign
Last synced: 3 months ago
JSON representation
Force set width and height to all image tags.
- Host: GitHub
- URL: https://github.com/tategakibunko/jquery.image-size-assign
- Owner: tategakibunko
- Created: 2015-03-08T00:20:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-08T00:59:15.000Z (about 10 years ago)
- Last Synced: 2025-01-12T08:33:23.949Z (4 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jquery.image-size-assign.js
jQuery plugin to force set `img` size attribute(width, height).
```html
![]()
```## How to use
```javascript
$(function(){
$("img").imageSizeAssign({
maxSize:{
width:500,
height:500
},
onSize:function(size){
return size;
},
onComplete:function(){
//console.log("all sizes are set");
}
});
});
```## Option
### maxSize
If defined, each size is rounded by `maxSize` if overflow, keeping original rate of size.
### onSize
Callback function after each size is obtained and rounded.
### onComplete
Callback function after all sizes are set.
## License
MIT