使用一些我几乎没有经验的 JQuery,并尝试使用
window.setTimeout(function() {
链接 4 个不同图像的淡入淡出。然而,它们同时也在逐渐消失。无法弄清楚我做错了什么。有任何想法吗?谢谢!
:javascript
$(document).ready(function($){
//$('.container.front-end h1').html($('.container.front-end h1').html().
replace('&', '<div class="h1-specialchar">&</div>'));
window.setTimeout(function() {
$('#fade1').removeClass('transparent').addClass('fadeInDown');
},1000);
window.setTimeout(function() {
$('#fade2').removeClass('transparent').addClass('fadeInDown');
},2000);
window.setTimeout(function() {
$('#fade3').removeClass('transparent').addClass('fadeInDown');
},3000);
window.setTimeout(function() {
$('#fade4').removeClass('transparent').addClass('fadeInRight');
},4000);
});
.row
.span5{:style => "width: 400px;"}
.pad-bottom70
=image_tag(@page.photos[1].image_url(:full), :id => "fade1", :class => "animated fadeInDown") if @page.photos[1].image?
.pad-bottom10
=image_tag(@page.photos[2].image_url(:full), :id => "fade2", :class => "animated fadeInDown") if @page.photos[2].image?
.pad-bottom5
=image_tag(@page.photos[3].image_url(:full), :id => "fade3", :class => "animated fadeInDown") if @page.photos[3].image?
.span7
- unless @page.photos.empty?
.pad-bottom70
=image_tag(@page.photos[0].image_url(:full), :id => "fade4", :class => "animated fadeInRight") if @page.photos[0].image?