Raú*_*Roa 1 firefox jquery internet-explorer google-chrome effects
我正在使用jQuery和fadeIn&fadeOut效果.我有以下代码显示和隐藏带有消息的div.
`
<script type="text/javascript">
$(document).ready(function() {
$("button").click(function() {
$("#upd").fadeIn(3000);
$("#upd").fadeOut(20000);
});
});
</script>
<style type="text/css">
div
{
background: rgb(237, 243, 254);
margin: 0px 0px 5px 0px;
padding: 13px 30px 13px 30px;
width: 300px;
}
</style>
Run Code Online (Sandbox Code Playgroud)
`
它在Internet Explorer上完美运行,但它在chrome中没有做任何事情,我在firefox中显示和隐藏行为.
这个库是否有一个特殊的步骤可以在所有浏览器中均匀地或至少接近地工作?
从fadeIn的回调中尝试fadeOut.这将确保后一个效果在第一个完成后运行,而不是在以下期间运行:
$(document).ready(function(){
$("button").click(function(){
$("#upd").fadeIn(3000,function(){
$(this).fadeOut(2500);
});
});
});
Run Code Online (Sandbox Code Playgroud)
jQuery 本身应该在所有浏览器中的工作方式几乎相同.如果你的行为很奇怪,你可能会做错事 - 不是jQuery :)
归档时间: |
|
查看次数: |
4543 次 |
最近记录: |