Reputation: 54949
I am using a set of images to build a gallery using a plugin. I want to add a last set as an click more link as shown bellow.
<div id="lightGallery" class="row no-gutter venue-photo-list" data-rel="venue-photos">
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium6.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium6.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium2.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium2.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium3.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium3.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium4.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium4.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium5.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium5.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2 more-photos"> <a href="http://google.com">More</a> </div>
</div>
When i click that button i would like to redirect to a different page and bypass the gallery plugin event. Any idea how i can force the click?
Upvotes: 1
Views: 2085
Reputation: 7424
You can bind the onclick event to it.
<a href="#" onclick="javascript: return false;">More</a>
Upvotes: 2
Reputation: 666
You can unbind the current event handler on the parent div, allowing the link click to go through:
$('div.more-photos').off('click');
Upvotes: 6