gpt4 book ai didi

javascript - Jon Raasch jQuery 幻灯片脚本无法在 Chrome 中为我工作?

转载 作者:太空宇宙 更新时间:2023-11-04 04:58:52 24 4
gpt4 key购买 nike

/*** 
Simple jQuery Slideshow Script
Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :)
***/

function slideSwitch() {
var $active = $('#slideshow IMG.active');

if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');

// uncomment the 3 lines below to pull the images in random order

// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );


$active.addClass('last-active');

$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 500, function() {
$active.removeClass('active last-active');
});
}

$(function() {
setInterval( "slideSwitch()", 2500 );
});

我需要滑动所有 5 张图片。问题是在第二张图片上停止并在刷新后继续正常工作。如果您粘贴网址(或在浏览器中按),这只会显示 2 张图片。

如果我将 animate 和 setinterval 都更改为 1000,则动画效果不佳。

谁能帮我解决这个问题。


它看起来像一个错误,因为如果我刷新页面,它就可以工作,但在我打开页面时却没有。这是错误的详细信息 https://stackoverflow.com/questions/11872278/is-this-a-bug-in-google-chrome-slider-not-worked

最佳答案

不确定是否是您想要的但更改了此内容:

$(function() {
setInterval( "slideSwitch()", 2500 );
});​

setInterval(slideSwitch, 2500);

Example

附言
适用于 Chrome v.21.0.1180.60 m

关于javascript - Jon Raasch jQuery 幻灯片脚本无法在 Chrome 中为我工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11869350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com