Can someone help me with this short piece of code? Right now, when I click a thumbnail on my site, it is creating a URL in the address bar. But url has .jpg at the end. How can I change the code so that it does not show .jpg at the end of the URL?
This part of the code also automatically opens the Colorbox image if the user enters a site with a URL, for example, www.domain.com/#image.jpg, so naturally, changing the code should also affect this.
Thanks!
jQuery(function() { var id, group; group = jQuery("a[rel='lightbox[63]']").colorbox({ onComplete: function() { window.location.hash = (this.pathname.match(/\/([^\/?#]+)$/i) || [,''])[1]; }, onClosed: function() { location.hash = ''; } }); id = location.hash.replace(/^\#/, ''); group.filter('[href$="'+id+'"]').eq(0).click(); });
source share