I need some help in jQuery. What I'm trying to do is to create some sort of a small picture gallery. In this gallery I've got a couple of small pics and one big pic. By clicking a small picture I want jQuery to load and replace the big picture.
Here's a little try which does not work! But probably someone could tell me why.
$(function(){
$("a.smallpics").click(function(e){
$(".bigpic")
.load(function () {
$(this).hide();
$('#loader')
.append(this);
.removeClass('loading')
$(this).fadeIn();
});
.attr('src', this.href);
e.preventDefault();
});
});
and the html
So in the best case the script would cover the big picture with a grey half transparent layer, start a spinner and after loading fading the picture in.
(Spinner is in background of class 'loading')
Thanks for your help.
From what I understand from your question you seem to want a jQuery gallery/slideshow thingie. There are many many plugins for this out there already. e.g. check this blueprintds.com/2009/01/20/…