我有一个关于Modernizr.load例程的问题,我无法开始工作。这是我的代码:
Modernizr.load([
{
//CDN reference provided by http://www.hongkiat.com/blog/css-javascript-fallback-methods/ | Jake Rocheleau
load: 'https://code.jquery.com/jquery-1.11.1.min.js',
complete: function () {
if (!window.jQuery) {
Modernizr.load('JavaScript/jquery-1.11.1.min.js');
}
}
},
{
load: [
'JavaScript/jquery.queryloader2.js',
'JavaScript/jquery.easings.min.js',
'JavaScript/jquery.slimscroll.min.js',
'JavaScript/jquery.fullpage.js'
],
complete: function () {
jQuery.noConflict(); // Block any conflicting jQuery markup from killing the workbench
jQuery(document).ready(function ($) {
/*
DOM Event attachment fix (adjustment made to attachEvent by removing the 'on'-prefix to eventName)
There must be a better way to bind events with prefixes?
Credit: http://stackoverflow.com/a/1695383/3305017
*/
function bindDOMEvent(el, eventName, eventHandler) {
if (el.addEventListener) {
el.addEventListener(eventName, eventHandler, false);
} else if (el.attachEvent) {
el.attachEvent(eventName, eventHandler);
}
}
bindDOMEvent(window, 'DOMContentLoaded', function () {
$('body').queryLoader2({
percentage: true
});
});
$('#fullpage').fullpage({
verticalCentered: true,
resize: false,
slidesColor: [''],
anchors: ['firstSlide', 'secondSlide', 'thirdSlide', 'fourthSlide'],
scrollingSpeed: 700,
easing: 'easeInQuart',
menu: false,
navigation: true,
navigationPosition: 'right',
navigationTooltips: ['', '', '', ''],
slidesNavigation: true,
slidesNavPosition: 'bottom',
loopBottom: false,
loopTop: false,
loopHorizontal: false,
autoScrolling: true,
scrollOverflow: true,
css3: true,
paddingTop: '0',
paddingBottom: '0',
fixedElements: '#element1, .element2',
normalScrollElements: '#element1, .element2',
keyboardScrolling: true,
touchSensitivity: 15,
continuousVertical: false,
animateAnchor: true,
//events
onLeave: function (index, direction) {
if (index == 3) {
$('.progressBarList').each(function () {
progressBar(100, $(this).find('.progressBar'));
});
}
},
afterLoad: function (anchorLink, index) {
if (index == 3) {
$('.progressBarList').each(function () {
progressBar($(this).find('.perc').html().replace('%', ''), $(this).find('.progressBar'));
});
}
},
afterRender: function () {
$('#scroll-navigation').delay(4000).fadeOut('slow');
},
afterSlideLoad: function (anchorLink, index, slideAnchor, slideIndex) { },
onSlideLeave: function (anchorLink, index, slideIndex, direction) { }
});
$.unbindall = function () {
jQuery('*').unbind();
};
// Kill memory leaks
$(document).unload(function () {
jQuery.unbindall();
});
});
}
}
]);
当我在Firebug中查看控制台时出现此错误:
TypeError:$(...)。fullpage不是函数。 [url] /jquery.fullpage.js [HTTP / 1.1 404 Not Found 20ms]
我错过了什么?为什么资源根本没有加载?
答案 0 :(得分:0)
您需要验证文件jquery.fullpage.js
错误404表示找不到此文件...