【发布时间】:2013-07-08 10:13:41
【问题描述】:
我需要将current_src 的值传递给mouseleave 函数。
console.log 返回undefined。
var current_src, swap_src;
jQuery(".browseProductImage").hover(
function(){
var 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)
}
);
【问题讨论】:
标签: javascript jquery jquery-hover mouseleave mousehover