0
init 함수의 변수를 내 객체의 bindEvent 함수에 전달하는 방법을 모르겠습니다. 현재로서는 정의되지 않습니다.정의되지 않은 변수 jQuery 객체
var Fisheye = {
init: function() {
$('body').hide();
$(window).load(function() {
$('body').fadeIn('slow');
this.imgs = $('.pic').children('img');
this.originalWidth = $(imgs).first().css('width');
this.minWidth = 300;
imgs.width(300);
Fisheye.bindEvents();
});
},
bindEvents: function() {
$(this.imgs).toggle(this.toggleClick, this.toggleClick);
console.log(this.imgs); // Why do I get Undefined here?
},
toggleClick: function() {
//Todo
}
}
Fisheye.init();
변수를 함수에서 다른 변수로 올바르게 전달하는 방법은 무엇입니까?
감사합니다.
위대한 init 함수의 기능
에 PARAM를 추가, 이해! 감사 – Chuck