このコードからmath.random関数を削除する方法を見つけようとしましたが、成功しませんでした。スライドを指定された文字列の順序で表示するために使用されるコードが必要です。math.randomを削除すると、最初の画像(htmlからリンクされている)が表示され、文字列の画像が読み込まれません。このコードからmath.randomを削除する方法を知っている人はいますか?
$(function() {
var images = ["home_photo_welshboy.jpg","home_photo_jam343.jpg","home_photo_xdjio.jpg","home_photo_ccgd.jpg"];
$('<img>').attr({'src':'http://l.yimg.com/g/images/'+images[0],'id':'bg','alt':''}).appendTo('#bg-wrapper').parent().fadeIn(1000);
$('.change').click(function(e) {
e.preventDefault();
var image = images[Math.floor(Math.random()*images.length)];
$('#bg').parent().fadeOut(200, function() {
$('#bg').attr('src', 'http://l.yimg.com/g/images/'+image);
$(this).fadeIn(200);
});
});
});