東西與此代碼歪去,但它的晚,我只是無法弄清楚:jQuery JSON淡入淡出 - 不工作?
var json_object = '.$json_twitter_array.';
function displayTweets(obj){
$("#tweetblock").html(obj[0].description).fadeIn("slow");
var i = 1;
setInterval(
function(){
$("#tweetblock").html(obj[i].description).fadeIn("slow");
i++;
if(i >= obj.length) i = 0;
},6000);
}
displayTweets(json_object);
它通過JSON對象就好循環,問題是淡入不工作,文本剛剛顯示。有人能指出我要去的地方有錯嗎?
非常感謝!
可能的重複:http://stackoverflow.com/q/1490563/1026459,也可能缺乏任何故障排除。 –