0
我的代码是这一个:jQuery函数赋值给变量
var hlpOpenPopup = function(open_id,close_id, animation){
if(typeof animation === 'undefined'){
animation = jQuery.slideDown;
}
jQuery(open_id).animation();
}
我想设置了slideDown方法为默认值,如果函数hlpOpenPopup被不带动画的说法。
了slideDown是一个jQuery的方法,我的代码不能正常工作,因为jQuery.slideDown等于undefined
将它设置为一个字符串并使用括号进行访问? – Li357
'slideDown'实际上是'jQuery.fn'的一个属性 – charlietfl
如果我做'animation = jQuery.fn.slideDown',然后我用'jQuery(open_id).animation()'调用它;'它不起作用 – Ferex