我正在尝试使用 jQuery Booklet 插件创建一本翻书。我正在关注可以在此处找到的教程。该页面只是说正在加载,之后没有任何反应。
这是我的代码:
HTML
<div class="book_wrapper">
<a id="next_page_button"></a>
<a id="prev_page_button"></a>
<div id="loading" class="loading">Loading...</div>
<div id="mybook" style="display:none;">
<div class="b-load">
<div>
<h2>Pen N Hand's Artwork </h2>
</div>
<div>
<img src="images/artwork/img.jpg" alt="" />
</div>
</div>
</div>
</div>
JS
$(function() {
var $mybook = $('#mybook');
var $bttn_next = $('#next_page_button');
var $bttn_prev = $('#prev_page_button');
var $loading = $('#loading');
var $mybook_images = $mybook.find('img');
var cnt_images = $mybook_images.length;
var loaded = 0;
//preload all the images in the book,
//and then call the booklet plugin
$mybook_images.each(function(){
var $img = $(this);
var source = $img.attr('src');
$('<img/>').load(function(){
++loaded;
if(loaded == cnt_images){
$loading.hide();
$bttn_next.show();
$bttn_prev.show();
$mybook.show().booklet({
//Booklet Options
});
}
}).attr('src',source);
});
});
我在 Firebug 中看不到任何错误。