我有一个正在构建的工作 jquery 图像轮播。它大部分完成了(只是增加按钮有效):http: //jsfiddle.net/2C8fy/7/
我面临的唯一问题是,当图像被附加时,它不会淡入。它只是出现。我尝试在右侧添加另一个不透明度为 0 的插槽,然后对其进行动画淡入,但这似乎也不起作用。如何为正确的插槽图像设置动画以使其看起来像是淡入淡出?这是我现在拥有的:
$('#basic_div').animate({ //slides the div with the images in it to the left.
left: '-=40px'
}, 300, function() {
});
left.animate({ //fade out effect for the left most image
opacity: 0
}, 300, function() {
left.remove(); //gets rid of left most image after it becomes invisible.
$('#basic_div').css({
left: '0px' //resets the div that contains the images
});
});
middle.attr('id', 'left_slot'); //changes ids
right.attr('id', 'middle_slot');
$("#basic_div").append(newImgSL);
newImgSL.attr('id', 'right_slot');
newImgSL.animate({
opacity: 100 //I thought this would make it fade in, but it still just appears.
}, 300);