{% extends "lizard_ui/lizardbase.html" %} {% block title %}Image scaling{% endblock %} {% block content %}

Automatic image scaling

Add an "a href" with class "replace-with-image" and it'll get replaced with an image. For example, the logo below. Do a comparison between what you get with "view source" and "firebug, that's the best way to see what happens. A width and height are added automatically, but they're empty by default.

image

If the "a href" has a direct parent with a "img-use-my-width" class (and similar for height), that parent's height/width is used. The below div is 100px high and 400px wide. Both a height and width parameter are added to the image url and the with/height attributes on the img tag are set.

image

The image is always fresh, as we also add an always-new timestamp parameter to the image's url.

{% endblock %}