Hey ya'll I have a problem and I have no idea how to solve with the lack of jquery skills I have.
I am using jquery colorbox for a gallery with my images, problem there are some duplicate images and I am trying to remove it. I don't even know where to start looking...if someone could give me a tip on where to start I would greatly appericate it (ps - its my bday)
I think this is where I need to remove the duplicates, but like I said my jquery skills are awful
// Preloads images within a rel group
if (settings.preloading) {
preload = [
getIndex(-1),
getIndex(1)
];
while (i = $related[preload.pop()]) {
src = $.data(i, colorbox).href || i.href;
if ($.isFunction(src)) {
src = src.call(i);
}
if (isImage(src)) {
img = new Image();
img.src = src;
}
}
}
Here is also the link to the file I am using...hope this helps
http://www.taranmarlowjewelry.com/wp-content/plugins/jquery-colorbox/js/jquery.colorbox.js?ver=1.3.19
After looking at your site, I had the same issue with colorbox...this will work
jQuery('document').ready(function($){
$(".wpcart_gallery a:first").removeClass("cboxElement");
jQuery(".wpcart_gallery img").click(function($){
jQuery(".wpcart_gallery a").addClass('cboxElement');
jQuery(this).closest('a').removeClass('cboxElement');
});
});
You can reach this using this jQuery code:
var arrayImgsColorbox = new Array();
$('.cboxElement').each(function(i, obj){
if($.inArray($(obj).attr('href'), arrayImgsColorbox ) > -1)
$(obj).removeClass('cboxElement');
else
arrayImgsColorbox[i] = $(obj).attr('href');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With