This time I will share jQuery Plugin and tutorial about Get The Size Of Child Elements – jQuery getSizeChilds, hope it will help you in programming stack.
getSizeChilds is a small yet sometimes might useful jQuery plugin which can be used to get the size (height & width) of child elements inside a given container.
How to use it:
1. Insert the minified version of the getSizeChilds plugin after loading jQuery JavaScript library.
2 |
integrity = "sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" |
3 |
crossorigin = "anonymous" > |
5 |
< script src = "getSizeChilds.js" ></ script > |
2. Get the total size of child elements.
1 |
< div class = "container" > |
3 |
var size = $( '.container' ).getSizeChilds(); |
3. Output the height & width in pixels.
1 |
alert( 'width:' + size.width + '; height:' + size.height); |
This awesome jQuery plugin is developed by wanes101. For more Advanced Usages, please check the demo page or visit the official website.