GIF动画不能在页面加载 [英] GIF not animating on page load
问题描述
我想创建一个初始页面(我知道,我试图说服他的话),显示标志动画(.gif注意)和一个按钮进入网站。到目前为止,我有一个 DIV
包含图像,但图像不动画正如人们所期望。出人意料的是,图像动画在Internet Explorer中每一次。我该如何去解决呢?
我试图用jQuery页面加载后的图像注入无济于事。
$(文件)。就绪(函数(){
$(#扑通)追加(< IMG SRC =IMG / logo_splash.gif'>中);
})
尝试附加一个随机数到你的GIF的网址。 Chrome和Firefox prevent从不止一次打多了GIF。
$(文件)。就绪(函数(){
$(#扑通)追加(< IMG SRC =IMG / logo_splash.gif?+的Math.random()+'/>中);
})
I am trying to create a splash page (I know, I tried to talk him out of it) that displays the logo animation (.gif) and a button to enter website. So far, I have a div
that contains the image, however, the image is not animating as one would expect. Surprisingly, the image animates every time in Internet Explorer. How do I go about solving this?
I have tried injecting the image after page load with jQuery to no avail.
$(document).ready(function() {
$("#splash").append("<img src='img/logo_splash.gif'>");
})
Try appending a random number to your GIF URL. Chrome and Firefox prevent a GIF from playing more than once.
$(document).ready(function() {
$("#splash").append("<img src='img/logo_splash.gif?"+ Math.random() + "'/>");
})
这篇关于GIF动画不能在页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!