--- layout: default title: Using images with imagesloaded.js description: A Shuffle.js demo using Desandro's imagesLoaded plugin. This comes in very handy when using shuffle with images affect the layout of shuffle items image: /demos/images.jpg extraJS: [ "imagesloaded.pkgd.js", "demos/images.js"] prism: true ---

Images!

You can encounter problems when shuffle item dimensions depend on images. Like this demo. There are three good solutions to this.

  1. Set an explicit height on .shuffle-items like the basic demo.
  2. Similar to number 1, make the height of the image container a percentage of the width. This can be seen in the nav images above with the div.keep-ratio.
  3. Get notified when images load (this page). In this case, I'm using Desandro's images loaded plugin. Please note that imagesloaded does not support IE7.
Loading...
{% for item in site.items %}
{{item.title}}
{{ item.groups }}
{% endfor %}

Shuffle.js

{{ site.longDescription }}

{% include credit-jake.html %}