
Горы
Media types
fancybox is designed to display images, video, iframes and any HTML content. For your convenience, there is a built in support for inline content and ajax.
Images
The standard way of using fancybox is with a number of thumbnail images that link to larger images:
<a href="image.jpg" data-fancybox="images" data-caption="My caption">
<img src="thumbnail.jpg" alt="" />
</a>
By default, fancybox fully preloads an image before displaying it. You can choose to display the image right away. It will render and show the full size image while the data is being received. To do so, some attributes are necessary:
data-width
- the real width of the imagedata-height
- the real height of the image
<a href="image.jpg" data-fancybox="images" data-width="2048" data-height="1365">
<img src="thumbnail.jpg" />
</a>
You can also use these width
and height
properties to control size of the image. This can be used to make images look sharper on retina displays. Example: