$(document).ready(function() {
var count = 0;
var images = [
"http://79.115.69.135:8521/UnderConstruction/Images/deestiny.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/dishonored.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/fallout4.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/fc3.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/halo5.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/me-som.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/rise.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/road4.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/southpark.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/subzero.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/tesv.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/thief.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/watchdogs.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/me-sow.jpg",
"http://79.115.69.135:8521/UnderConstruction/Images/wot.jpg",
];
var image = $(".background");
image.css("background-image", "url(" + (images[count] + ")"))
setInterval(function() {
image.fadeOut(1500, function() {
image.css("background-image", "url(" + images[count++] + ")");
image.fadeIn(1500);
});
if (count == images.length) {
count = 0;
}
},10000); });
私は新しいイメージを追加するたびに、私はhttp://ip.com/folder/folder/img.imgで新しい行を記述する必要が....このJavaScriptコードを持っている... 1.Howは、私はそれがために作ることができますランダム...ランダムな画像を選択! 2. ip.comで1行だけを作る方法...画像を追加したいときに改行したことはありません!乱数についてJavascriptのイメージトリック
1.あなたがGoogleのJavascriptの乱数を試してみましたか? – SLaks
2.文字列連結の驚異を探しています。 – SLaks
はい、しかし、私はファイル/画像でそれを使用する方法を知らない。 –