0
我一直在玩一個腳本,將圖像從低質量的版本替換爲高質量的版本,替換工作正常,但是,我需要替換的圖像淡入慢慢地而不是像現在這樣立即被替換。如何製作替換圖像fadeIn()
//For each of the images in the class
$(".image-to-be-reloaded").each(function (i, classReturn) {
var image = classReturn.firstChild; //Gets the image for that element
//Get the original source
var originalSource = image.src;
//Replaces the preview within the query string to use the high quality version.
var finishedSource = //My replace method goes here
image.src = finishedSource; //Update the image src
$(classReturn).replaceWith(image).fadeIn(10000);
});
雖然前面的文字肯定是我正在使用的淡入淡出,但我在這裏做錯了什麼?