我正在加载以下jquery,有时它按预期工作,但有时它没有,我不明白为什么?
当它工作时我在firebug中没有错误,但是它不起作用的时间我得到一个错误 TypeError:b.pageZoom未定义
$this->template->jscripts = array (
'assets/libraries/jquery-ui-1.8.12.custom.min.js',
'assets/libraries/jquery.validate.min.js',
'assets/scripts/turn.min.js',
'assets/scripts/turn.html4.min.js',
'assets/libraries/modernizr.2.5.3.min.js',
'assets/scripts/scripts.js?v=1.0'
);
我的代码来自scripts.js?v = 1.0
function loadApp() {
// Create the flipbook
$('.flipbook').each(function(){
$(this).turn({
// Width
width:922,
// Height
height:600,
// Elevation
elevation: 50,
// Enable gradients
gradients: true,
// Auto center this flipbook
autoCenter: true
});
});
}
// Load the HTML4 version if there's not CSS transform
$(document).ready(function() {
yepnope({
test : Modernizr.csstransforms,
yep: ['../../lib/turn.js'],
nope: ['../../lib/turn.html4.min.js'],
both: ['css/basic.css'],
complete: loadApp
});
});