【发布时间】:2015-07-22 20:20:33
【问题描述】:
我有这样的脚本代码:
setTimeout(function () {
$('.grayscale .inactive img').each(function () {
$(this).wrap('<div style="display:inline-block;width:' + this.width + 'px;height:' + this.height + 'px;">').clone().addClass('gotcolors').css({
'position': 'absolute',
'opacity': 0
}).insertBefore(this);
this.src = grayscale(this.src);
}).animate({opacity: 1}, 500);
$(".grayscale li").hover(function () {
$(this).find('.gotcolors').stop().animate({opacity: 1}, 200);
}, function () {
$(this).find('.gotcolors').stop().animate({opacity: 0}, 500);
});
}, 1);`
我在 Mozilla Firefox 中需要它,在 Chrome 中我对这个 grayscale(this.src) 有错误。我怎样才能只为 Mozilla Firefox 包含这个脚本?
【问题讨论】:
标签: javascript jquery reference conditional-statements jquery-events