我需要为图像创建一个 css,即高度和宽度。如何创建?
<div id="toHide" class="pb-text-align-center">
<img src="img/load.gif" style="margin-left: auto; margin-right: auto;"/>
<form wicket:id="safeForm" class="clearfix" />
</div>
.pf-text-align-center, .pb-text-align-center { text-align: center; }
<script type="text/javascript">
var $ = jQuery.noConflict();
$('#toHide').doTimeout(1000, function() { $('#toHide').find('#safeForm35').submit();});
</script>
问题:IE 中没有发生动态动画 Action 。它可以通过正确的高度和宽度来解决。我怎样才能看到所需的高度和宽度是多少?和其他细节?
编辑
Answer:
HTML 源代码:
<SCRIPT type="text/javascript">
var $ = jQuery.noConflict();
document.getElementById('toHide').style.display ="";
$('#toHide').doTimeout(1000, function() {
$('#toHide').find('#safeForm34').submit();
document.getElementById('myAnimatedImage').src = "../../img/load.gif";
});
</SCRIPT>
html:
<div id="toHide" class="pb-text-align-center">
<img src="img/load.gif" id='myAnimatedImage' style="margin-left: auto; margin-right: auto;"/>
<form wicket:id="safeForm" class="clearfix" />
</div>
最佳答案
对您来说是个坏消息 - 您遇到了 IE 中的一个已知错误。
在 IE 中,如果您加载动画 GIF,但加载时它是不可见的,那么当您使其可见时动画将不起作用。
解决方法是通过设置 src
属性在您需要显示的时候加载图像,而不是预先加载它并使其可见。
引用:http://www.norio.be/blog/2008/09/animated-gif-not-working-internet-explorer
关于javascript - 动画图像的CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6153394/