问题
I'm developing a single page wordpress website for our client. In that i have used flexslider in header section and some other jquery plugins. All of them were working till today morning but now I found that the flexslider stopped working.
I'm not able to find out the reason.
Please help me to solve this issue as I have to submit this project today.
Error Found on Firebug Console:
TypeError: $(...).flexslider is not a function
animation: "slide"
- /Demo/website/ (line 34)
How can i fix this? Any help will be appreciated..
Thanks in advance..
回答1:
The jquery.flexslider.js is not loading. Try removing the defer
keyword from or add type="text/javascript"
and see if it works. Your current source:
<script defer src="http://www.yourwebsite.com/Demo/allabout/wp-content/themes/twentytwelve/js/jquery.flexslider.js"></script>
I suggest you try
<script type="text/javascript" src="http://www.yourwebsite.com/Demo/allabout/wp-content/themes/twentytwelve/js/jquery.flexslider.js"></script>
回答2:
Try this.. hope this will work.
(function($) {
$(window).load(function(){
$('.flexslider').flexslider({
--------- YOUR CONFIGURATIONS --------
});
});
})(jQuery);
来源:https://stackoverflow.com/questions/15103424/flexslider-stopped-working-firebug-shows-typeerror-flexslider-is-not-a