我想做一个幻灯片产品的东西,如http://www.mediatemple.net主页,那里有那些大的圆点在右边。我试着用谷歌搜索,但找不到类似的。
发布于 2010-05-08 13:40:15
他们的代码直接在页面中。稍微研究一下css,就会把您引向正确的方向。
$(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);
});
}发布于 2010-05-08 13:38:52
试试jQuery Cycle插件:http://jquery.malsup.com/cycle/
发布于 2011-01-11 18:24:04
我推荐使用jQuery Nivo Slider:http://nivo.dev7studios.com/
https://stackoverflow.com/questions/2793050
复制相似问题