Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- var $container = $('#am-container'),
- $imgs = $container.find('img').hide(),
- totalImgs = $imgs.length,
- cnt = 0;
- $imgs.each(function(i) {
- var $img = $(this);
- $('<img/>').load(function() {
- ++cnt;
- if (cnt === totalImgs) {
- $imgs.show();
- $container.montage({
- fillLastRow: true,
- alternateHeight: true,
- alternateHeightRange: {
- min: 75,
- max: 300
- }
- });
- /*
- * just for this demo:
- */
- $('#overlay').fadeIn(500);
- }
- }).attr('src', $img.attr('src'));
- });
- });
- <div class="main-gallary">
- <div class="container">
- <div id="am-container" class="am-container">
- <a href="#">
- <img class="ui-draggable" src="images/gallary/img-1.jpg" style="display: inline; position: relative;">
- </a>
- <a href="#">
- <a href="#">
- </div>
- </div>
- </div>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
- <script type="text/javascript" src="js/jquery.montage.min.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement