20130526071601137  

 

<script type="text/javascript">
GetRumdomStr = function () {
var str = "";
var maxNum = 10;
var minNum = 0;
var n = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
for (var i = 1; i <= 50; i++) {
n = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
str += n.toString();
}
return str;
};
$(document).ready(function () {
$('img').hide();
var ImgCount = $('img').length;
$('img').each(function () {
var str = GetRumdomStr();
var url = $(this).attr("src");
$(this).attr("src", url + "?" + str);
function ImageLoading() {
msg = "Image ID : " + this.id + "....done";
console.log(msg);
$('#msg').append("<div>" + msg + "</div>");
$(this).fadeIn(2000);
ImgCount--;
if (ImgCount === 0) {
console.log("All images Loaded..");
}
}
if ($(this).complete) {
imageLoaded.call(this);
} else {
$(this).one('load', ImageLoading);
}
});
});
</script>

創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()