0
我有一個使用背景圖片的CSS樣式(代碼:background-image: url("folderimage.jpg");
)。有沒有辦法使用jQuery/CSS在多個CSS背景圖片之間旋轉? (請舉例說明)。CSS - 旋轉背景圖片
我有一個使用背景圖片的CSS樣式(代碼:background-image: url("folderimage.jpg");
)。有沒有辦法使用jQuery/CSS在多個CSS背景圖片之間旋轉? (請舉例說明)。CSS - 旋轉背景圖片
這種東西會工作我還沒有測試代碼,但想法是有一個數組的五個圖像,並在超時更改它們。如果您需要,我可以向您解釋代碼。
var theImages = new Array();
theImages[0] = '1.gif'
theImages[1] = '2.gif'
theImages[2] = '3.gif'
theImages[3] = '4.gif'
theImages[4] = '5.gif'
function changeBGImage(){
var whichImage = Math.round(Math.random()*(p-1));
jQuery('#elementHavingProperty').css('background-image','url('+theImages[whichImage+'])');
}
movement = setTimeout("changeBGImage()",1000000);
也許是話題。但你可以檢查我的代碼是如何旋轉頁面上的所有內容的。
你試過*什麼*? – Blender 2012-04-27 06:10:51
你是什麼意思的旋轉。你想在一段時間內改變它們嗎? – 2012-04-27 06:11:02
@sushilbharwani - 是的。我會使用圖像1-5,然後旋轉。 – L84 2012-04-27 06:11:44