I want to do a slideshow for product something like http://www.mediatemple.net home page, where there with those big dots on the right. Tried to google but couldn't find one similar.
A:
Their code is directly in the page. A little investigation in the css should lead you in the right direction.
$(document).ready(function() {
var nrgtiles = $('div[class^=homesplash]').length;
/* alert(nrgtiles); */
$('body').append('<div id="nrgrotate"> </div>');
var i=1;
while (i<=nrgtiles) {
$('#nrgrotate').append('<a href="#"><em> </em></a>');
i++;
}
$('#nrgrotate a:eq(0)').addClass('active');
$('#nrgrotate a:eq(0)').click(function() {
homeFadeOut();
return false;
});
$('#nrgrotate a:eq(1)').click(function() {
homeFadeIn();
return false;
});
$('.homesplash2').hide();
timer = setTimeout(homeFadeIn, 10000);
});
function homeFadeIn() {
clearTimeout(timer);
$('#nrgrotate a:eq(0)').removeClass('active');
$('#nrgrotate a:eq(1)').addClass('active');
$('.homesplash2').fadeIn(1000, function() {
timer = setTimeout(homeFadeOut, 10000);
});
}
function homeFadeOut() {
clearTimeout(timer);
$('#nrgrotate a:eq(1)').removeClass('active');
$('#nrgrotate a:eq(0)').addClass('active');
$('.homesplash2').css('margin-top', '-263px').fadeOut(1000, function() {
timer = setTimeout(homeFadeIn, 10000);
});
}
Gabriel
2010-05-08 05:40:14
Thank you. Will look into it.
Victor
2010-05-09 10:40:25