試試這個也許? 確保jQuery是包含在頁面的頂部(我主持我的自己,但你也許可以得到谷歌主辦)它看起來是這樣的:
<script type="text/javascript" src="path/to/jquery.min.js"></script>
然後你把這個在頁面的底部:
<script type="text/javascript">
$(document).ready(function() {
$(".slide").bind("click", function(){
$(".sqs-active-slide").fadeOut(500, function(){
//change active slide here
//remove class from current active slide
//then run the following line
$(".sqs-active-slide").fadeIn(500);
});
});
window.setInterval(slideClick, 9000);
});
function slideClick()
{
$(".slide").click();
}
</script>
這將只停留在同一張幻燈片上,因此您必須添加代碼才能轉到下一張幻燈片,因爲您沒有提供足夠的代碼,所以我無法猜測要執行什麼操作。
編輯: 的原因,它不會工作,是因爲在我的例子中,你將不得不改變的jQuery的$因爲你的jQuery是配置這樣 然而,尋找:
if ($active.length == 0) $active = jQuery('#slideshow span:last');
變化的休息該功能後行:
var $next = $active.next().length ? $active.next() : jQuery('#slideshow span:first');
$active.addClass('last-active');
$active.fadeOut(500, function(){
$next.addClass('active').fadeIn(500);
});
請提供完整的jsfiddle –
什麼?這是我所添加的。我不知道如何找到整個代碼。 –