我很难让 jquery 淡化和不透明 css 元素在我正在编写的 firefox 扩展中响应我。我正在使用 FireFox 3.6。我很确定这两个问题是相关的。
这段代码没有褪色,它只是在等待四秒后在屏幕上弹出和关闭:
css_notify_div = {
position: 'fixed',
top: '2%',
right: '2%',
font: 'bold',
'font-size': '1.5em',
'font-family': 'sans-serif',
'text-align': 'center',
'background-color': 'ffff88',
'border': '2px solid #eeee00',
'padding': '5px',
margin: 'auto',
display: 'none'
};
doc = window.content.document;
$('#br_notify_div', doc).css(css_notify_div);
$('#br_notify_div', doc).fadeIn("slow", function () {
$('#br_notify_div', doc).fadeOut(4000);
});
我每次运行 fadeTo() 也会失败,如果我使用 css({opacity:'.2'}) 那么也不会发生任何事情。
编辑:这似乎特定于 firefox 扩展环境。其他动画效果很好,例如 show('slow') 看起来很好。这似乎与使用 opacity 属性本身有关,它似乎不仅仅是一个 jQuery 问题。
最佳答案
我试过了here它似乎工作正常..?
(Linux 上的 FF 3.6.6)
关于javascript - Firefox 扩展中的不透明度和 jQuery 淡入/淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3182966/