An open API service indexing awesome lists of open source software.

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.

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