• Hello,

    I’m setting up a full-width portfolio with 5-10 images in each project. When clicking on the project, a Lightbox appears beginning with the image that was clicked, after which a user can cycle through all the subsequent images.

    But, when a user reaches the last image in the project, the Lightbox show doesn’t stop; rather, it takes the user to the first image in the next project.

    For my purposes, this behavior is undesirable.

    Is there a way to make different Lightbox instances so that they display only images in the project a user selects?

    Thanks,

    Jonathan

    https://wordpress.org/plugins/portfolio-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello
    Dear user indeed our Lightbox is made to show all images, we will make updates on that in the future, but you can stop it when it is on last image.
    From General options there is a way to stop sliding to the first image after last image.

    Thread Starter jspiliotopoulos

    (@jspiliotopoulos)

    Hello,

    Thank you for your response.

    Being the impatient person that I am, I found a solution of my own. Perhaps it can act as a starting point for you; or a way to help somebody else with this issue.

    The first step is to create multiple portfolios rather than multiple projects. (If you style them the same, and put them on the same page, they’ll render the same way a list of projects would).

    At this point, the behavior persists — eg, the Lightbox will cycle through all images on the page, even though they’re in separate portfolios.

    Ergo, the second step is to do a little code editing…

    Front_end/portfolio_front_end_view.php (lines 860 and 861) says this by default:

    jQuery("#huge_it_portfolio_content_1 a[href$='.jpg'], #huge_it_portfolio_content_1 a[href$='.png'], #huge_it_portfolio_content_1 a[href$='.gif']").addClass('group1');
    jQuery(".group1").colorbox({rel:'group1'});

    They key here is the group1 class. It’s what divides the Lightbox galleries. So I changed group1 to “group<?php echo $portfolioID; ?>” which changes the Lightbox group with each portfolio on the page.

    New code:

    jQuery("#huge_it_portfolio_content_<?php echo $portfolioID; ?> a[href$='.jpg'], #huge_it_portfolio_content_<?php echo $portfolioID; ?> a[href$='.png'], #huge_it_portfolio_content_<?php echo $portfolioID; ?> a[href$='.gif']").addClass('group<?php echo $portfolioID; ?>');
    jQuery(".group<?php echo $portfolioID; ?>").colorbox({rel:'group<?php echo $portfolioID; ?>'});

    And with this, each section on the page gets its own Lightbox group that begins and ends with that group — which is exactly what I wanted.

    Thanks for your time and attention. 🙂

    Jonathan

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Lightbox images looping through all projects’ is closed to new replies.