0
嗨,人們有一個問題,我無法工作,我使用imageswitch來創建幻燈片。jquery幻燈片,索引不推進
我有以下的jquery:
// set up slideshow
var IdxTR = <?php echo($totalRows_rs_gallery); ?>;
var Idx =0;
var ChangeImage = function(){
console.log('Idx: '+Idx+' - IdxTR: '+IdxTR+' Img: '+$(".SlImage").eq(Idx).attr("rel"));
//If the image still animating, stop it and start the new one
$("#mainImage").ImageStop(true,true);
$("#mainImage").ImageSwitch({NewImage: $(".SlImage").eq(Idx).attr("rel")});
//Set the next image will be display
Idx = Idx++;
console.log('AFTER --- Idx: '+Idx+' - IdxTR: '+IdxTR+' Img: '+$(".SlImage").eq(Idx).attr("rel"));
if(Idx>IdxTR){
Idx = 0;
}
//Start preload the next image
$.ImagePreload($(".SlImage").eq(Idx).attr("rel"));
};
var StartSlideShow = function(){
IntervalKey = setInterval(ChangeImage,1000);
};
StartSlideShow();
和在我的HTML我有:
<div id="topcontainer">
<img id="mainImage" src="images/gallery/<?php echo $row_rs_gallery['image_gly']; ?>" />
<?php do { ?>
<div class="SlImage" rel="images/gallery/<?php echo $row_rs_gallery['image_gly']; ?>"/>
<?php } while ($row_rs_gallery = mysql_fetch_assoc($rs_gallery)); ?>
</div>
第一的console.log輸出:IDX:0 - IdxTR:8圖:圖像/像冊/alison.jpg
但第二個consloe.log不顯示,並且當ChangeImage()函數再次運行時,idx不是高級的,並且第一個console.log輸出相同: Idx:0 - IdxTR:8圖:圖片/圖庫/ alison.jpg
任何想法爲什麼索引不先進?或爲什麼第二個console.log不運行?
嗨,謝謝,我不能看到在螢火蟲的其他錯誤?我注意到了console.log和Idx ++之間的所有內容,第二個console.log現在運行,但索引仍然不是先進的 http://new.camerich.co.uk/information4.php?id_sec=2 – 2011-04-28 11:02:08
添加了一些東西。嘗試這個? – Nanne 2011-04-28 11:11:04
不錯,你可以把咖啡擱置一下......改變Idx = Idx + 1; 現在索引正在前進,有時間查看其他位,你用什麼來獲得這個錯誤?我在螢火蟲1.62,並沒有出現。 – 2011-04-28 11:16:39