【发布时间】:2015-02-09 18:31:54
【问题描述】:
我遇到了一个问题,我试图在选择器上调用函数,并使用 jQuery 编辑/添加类到该选择器中的元素。
下面是我的代码:
(function($) {
$(document).on('click', '.one a.button', function(){
$('.two').loadQuestions();
});
})(jQuery);
function loadQuestions( $ ) {
$(this).addClass('active');
$(this).children().addClass('transition-in');
$(this).find('.tilt').delay(100).textillate({
in: { effect: 'fadeInLeft' }
});
它一直给我这个错误:
undefined is not a function - in regards to:
$('.two').loadQuestions();
【问题讨论】:
-
你需要使用'$.fn'。在你的函数中,可以在这个线程中看到:stackoverflow.com/questions/12093192/…
标签: javascript jquery html css