geting an image size in Meteor
When using Meteor it can be tricky to get at computed properties for DOM objects. This is the case with images which are not displayed until after the template has rendered.
This is important as it is not possible to check for image size in the Template.myTemplate.rendered callback
I ended up using the imagesloaded
JQuery plugin which works nicely with Meteor
Just place the minified JS in the public folder of your app and include it in your HTML
<script type="text/javascript" src="/js/jquery.imagesloaded.min.js"></script>
the content of the public folder is accessible under /
Written by Micha Roon
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Related Tags
#meteor
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#