更改此jQuery的图像幻灯片
问题描述:
的“标题”动画的方式,我发现这个伟大的jQuery的幻灯片: http://slidesjs.com/examples/images-with-captions/更改此jQuery的图像幻灯片
不过,我想它所以“标题”区域不会消失,并显示各自图片。如果只是根据新图像更改文字,我更喜欢。
这是可能的,如果是这样,我该如何做到这一点?
以供参考,在这里是文件:slides.min.jquery.js(http://slidesjs.com/examples/images-with-captions/js/slides.min.jquery.js)
,这里是正在使用的JavaScript代码的一个片段:
animationStart: function(current){
$('.caption').animate({
bottom:-35
},100);
if (window.console && console.log) {
// example return of current slide number
console.log('animationStart on slide: ', current);
};
},
animationComplete: function(current){
$('.caption').animate({
bottom:0
},200);
if (window.console && console.log) {
// example return of current slide number
console.log('animationComplete on slide: ', current);
};
},
slidesLoaded: function() {
$('.caption').animate({
bottom:0
},200);
}
非常感谢任何指针。
答
animationStart: function(current){
if (window.console && console.log) {
// example return of current slide number
console.log('animationStart on slide: ', current);
};
},
animationComplete: function(current){
$('.caption').animate({
bottom:0
},200);
if (window.console && console.log) {
// example return of current slide number
console.log('animationComplete on slide: ', current);
};
},
slidesLoaded: function() {
$('.caption').animate({
bottom:0
},200);
}
从事示例页面的工作。
|编辑|这里有100%的工作示例:http://jsfiddle.net/byvd9/1/
答
我做了一个调整,使图像在进入carreganda后以不透明度开始的不透明度消失 - 请记住,如果您选择淡入淡出过渡效果,不透明度中的标题淡入淡出,但只能确保可以感知效果,或者如果您希望它更像atrazado来打开图像。
<script>
$(function(){
$('#slides').slides({
preload: true,
//preloadImage: 'img/banner/carregando.gif',
play: 5000,
pause: 2500,
effect: 'fade',
fadeEasing: "easeOutQuad",
fadeSpeed: 850,
hoverPause: true,
animationStart: function(current){
$('.caption').animate({
bottom:0,
opacity:0
},100);
if (window.console && console.log) {
// example return of current slide number
console.log('animationStart on slide: ', current);
};
},
animationComplete: function(current){
$('.caption').animate({
bottom:0,
opacity:1
},600);
if (window.console && console.log) {
// example return of current slide number
console.log('animationComplete on slide: ', current);
};
},
slidesLoaded: function() {
$('.caption').animate({
bottom:0,
opacity:1
},600);
}
});
});
</script>
尝试删除第一个字幕 - 动画部分? – OptimusCrime