I have some thumbnails + a camera icon on a page and a main image, currently you click the thumbnail and the main image fades out and a full size version fades in of the thumbnail.
Now if a user clicks the camera icon the full image should fade out and a swf video should fade in, how can I achieve this?
Here is the current code i’m using for the images:
$('a.thumbnail').click(function(){
var src = $(this).attr('href');
if (src != $('img#full_image').attr('src').replace(/\?(.*)/,'')){
$('img#full_image').stop().animate({
opacity: '0'
}, function(){
$(this).attr('src', src+'?'+Math.floor(Math.random()*(10*100)));
}).load(function(){
$(this).stop().animate({
opacity: '1'
});
});
}
return false;
});
Right so here’s the code that I am using:
This will get most of you roughly started. You will probably want to create some sort of loading, for images which are large, or a preloader.
Also this code just switches image / swf it does not
fadeIn/fadeOut(because of the flash file). When I get some time I may look into trying to create the effect by overlaying a white image(my background I’m using is white) and increase its opacity etc.Thanks