dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Need help to tweak a jQuery photo gallery

  1. #1
    Join Date
    May 2017
    Posts
    2

    Need help to tweak a jQuery photo gallery

    I want to incorporate into my web-site this photo gallery (makes a collage): https://tympanus.net/codrops/2011/08...-image-montage (that's the source with hooked up LightBox to it - http://blog.harrix.org/wp-content/up...thLightBox.zip)

    For the present this gallery can be used only once at a web-page, since it's placed there via unique <div class="am-container" id="am-container">
    I'd like to use as many divs as I want, i.e. having several collage galleries on the same web-page.

    I found a mod (code below) which allegedly can achieve this, but with my poor knowledge I don't know exactly how to accomplish it. Would appreciate any help! Thank you!
    Code:
    $(‘.container’).each(function(){
    var $container = $(this),
    $imgs = $container.find(‘img’).hide(),
    totalImgs = $imgs.length,
    cnt = 0;
    
    $imgs.each(function (i) {
    var $img = $(this);
    $(”).load(
    function () {
    ++cnt;
    if (cnt === totalImgs) {
    $imgs.show();
    $container.montage({
    minw:120,
    liquid:false,
    alternateHeight:true,
    alternateHeightRange:{
    min:120,
    max:480
    },
    margin: ,
    fillLastRow:true
    });
    
    }
    }).attr(‘src’, $img.attr(‘src’));
    });
    });
    });

  2. #2
    Join Date
    May 2017
    Posts
    2
    Sorry - the mod code is the following:

    Code:
    $(window).load(function () {
    
    $(‘.container’).each(function(){
    var $container = $(this),
    $imgs = $container.find(‘img’).hide(),
    totalImgs = $imgs.length,
    cnt = 0;
    
    $imgs.each(function (i) {
    var $img = $(this);
    $(”).load(
    function () {
    ++cnt;
    if (cnt === totalImgs) {
    $imgs.show();
    $container.montage({
    minw:120,
    liquid:false,
    alternateHeight:true,
    alternateHeightRange:{
    min:120,
    max:480
    },
    margin: ,
    fillLastRow:true
    });
    
    }
    }).attr(‘src’, $img.attr(‘src’));
    });
    });
    });

  3. #3
    Join Date
    Dec 2012
    Posts
    1,542
    Unite gallery is looking very similar:
    http://unitegallery.net/index.php?page=tiles-nested
    Reading the instructions here:
    http://unitegallery.net/index.php?pa...ng_the_gallery
    I assume that this gallery can manage multiple instances. Give it a try.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center