Include JavaScript and CSS files in HEAD tag.
Note: Only include the hammer.js when swipe support is required.
<head> <link rel="stylesheet" type="text/css" href="css/metro_gallery.css" /> <script type="text/javascript" src="javascript/jquery.js"></script> <script type="text/javascript" src="javascript/jquery.masonry.min.js"></script> <script type="text/javascript" src="javascript/hammer.js"></script> <script type="text/javascript" src="javascript/metro_gallery.min.js"></script> </head>
Include the following code to your HTML code
<img src="image_001.jpg" data-caption="xxxx" /> <img src="image_002.jpg" data-caption="xxxx" /><img src="image_003.jpg" data-caption="xxxx" /><img src="image_004.jpg" data-caption="xxxx" /> <img src="image_005.jpg" data-caption="xxxx" /><img src="image_006.jpg" data-caption="xxxx" /> <img src="image_007.jpg" data-caption="xxxx" />
Use setOptions() to change the global settings. Each setting is optional.
<script type="text/javascript"> Metro_Gallery.setOptions({ base_size: 100, gutter: 10, scale: 1.4 }); </script>
...
...
...
div.tile.black, div.tile.black div.caption { background: #000000; }
...
...
...
<img src="image_006.jpg" data-caption="xxxx" />
<img src="image_006.jpg" data-caption="xxxx" data-captionlink="http://www.example.com" />
<img src="image_006.jpg" data-preview="image_006_big.jpg" />
<img src="image_006.jpg" data-link="http://www.google.com" />
...