0
mouseleave 함수에 current_src
값을 전달해야합니다.jQuery - 마우스 오버 기능 내에서 변수를 가져올 수 없습니다. (mouseleave)
console.log는 undefined
을 반환합니다.
var current_src, swap_src;
jQuery(".browseProductImage").hover(
function(){
current_src = jQuery(this).attr('src');
var swap_src = jQuery(this).next().attr('src');
jQuery(this).attr('src', swap_src);
},
function(){
jQuery(this).attr('src', current_src);
console.log(current_src)
}
);
가 그냥 자리 :
– RhymeGuy어쨌든 답변을 수락하는 것을 고려하십시오 ... –