<section id="bookBox"<?# bookStyle ?>>
	<div class="page_title"><?# indexBTitle ?></div>
	<ul class="nowrap_box">
		<php:repeater id="listB">
		<template>
		<li class="scale_box"><a class="img_box_cover" href="<?# link ?>" title="<?# BookName ?>"><img src="<?# BookImage ?>" alt="<?# BookName ?>" /></a></li>
		</template>
		</php:repeater>
	</ul>
</section>
<script>
    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 () {
        $('#bookBox img').hide(); //先把所有圖片先隱藏
        var ImgCount = $('#bookBox img').length; //取得圖片的個數
        $('#bookBox img').each(function () {
            var str = GetRumdomStr(); //請忽略,讓圖片加隨機亂數,視為模擬未曾下載過的圖片
            var url = $(this).attr("src");
            $(this).attr("src", url + "?" + str);
 
            function ImageLoading() {
                $(this).fadeIn(2000);
                ImgCount--;
            }
 
            if($(this).complete){
                imageLoaded.call(this);
            }else{
                $(this).one('load', ImageLoading);
            }
        });
    });
</script>