Reputation: 54
I have images that opens in lightbox. I'm trying to make one image not open in lightbox. Best way to do it, is if I change <a href...></a>
to <b href></b>
, so it doesn't have function, span
what ever.
My jQuery:
$('.post-101 a').replaceWith(function () {
return $('.post-101 b', {
html: $(this).html()
});
});
Upvotes: 0
Views: 58
Reputation: 766
Broken html is not a good idea. Try catching the click event and stop it form going to lightbox plugin.
Something like this might work.
$( "a.no-lightbox" ).click(function( event ) {
event.stopPropagation();
});
More info on jQuery docs
Upvotes: 2