[jQuery] Bug in my gallery, wtf?!
Before I post a link:
A. Yes, the code is messy, I have been trying to fix this all day, and
I have restructured my code at least a dozen times, and that is why it
is so messy, so please don't say "try cleaning it up" :)
B. There are 100s of images, I just haven't sliced them all out from
the client's PDF yet, so only "pneumatic" and "vintage" load a set of
images.
C. Thumbs don't match with the large images yet, because I haven't sat
down and matched the 100s of images yet, but it works correctly! :)
OK so on with it:
http://boozker.com/beall/
Everything works perfectly ON LOAD! :(
If you click on my custom carousal everything works. thumbs, left, and
right arrows work fine.
The 1 step arrows (ones on the black bar) work fine and even update
the count correctly.
However, ALL of this breaks when I reload with a click like this:
$('#gallery_nav ul a').click(function(){
var new_set = $(this).attr('title').toLowerCase();
$.get("js/get_images.php", { set:new_set }, function(data){
$('#carousel_wrapper ul').empty().append(data);
activate_gallery();
});
});
Here is my window load:
$.get("js/get_images.php", { set:'history' }, function(data){
$('#carousel_wrapper ul').empty().append(data);
activate_gallery();
});
After you click on a new category, it basically run activate_gallery
(); twice, and so when you click next on either arrows it jumps x2. If
you change the category 3x it jumps 3x etc
I KNOW it has to do with activate_gallery but I have NO CLUE how else
to write it. :(
Remember, I have move code chunks all over. Does anyone have any ideas
on how to get this to work?