【发布时间】:2013-12-22 16:36:33
【问题描述】:
您好,我有一个雪地 gif 动画,这里有 2 个不同的 gif:
http://archibaldbutler.com/projects/stack/
一个正在下雪,但另一个没有,我希望他们都在页面上“下雪”,而不是一个,目前。
我遵循的教程仅用于制作一个动画 gif。所以我复制了降雪脚本并将其命名为 snowfall2.jquery.js
<script src='snowfall.jquery.js'></script>
<script src='snowfall2.jquery.js'></script>
我在 snowfall2 中进行了搜索并替换,以将“snowfall”替换为“snowfall2”。
在我的 index.html 的标题中,我添加了对 snowfall2.jquery.js 的调用,它调用了 gif 图像:
<script type='text/javascript'>
$(document).ready(function(){
$('.collectonme').hide();
//Start the snow default options you can also make it snow in certain elements, etc.
$(document).snowfall({image :"images/santa-sneaking-smiley-emoticon2.gif", minSize: 40, maxSize:100});
$(document).snowfall2({image :"images/santa-sneaking-smiley-emoticon22.gif", minSize: 40, maxSize:100});
});
</script>
我的问题是:一个 gif:偷偷摸摸的圣诞老人正在“下雪”,但跳跃的圣诞老人没有“下雪”。为什么?
【问题讨论】:
-
一个
$(document).ready()就够了!将脚本合并到一个文档中 -
我现在已经做到了,但我的跳跃圣诞老人仍然没有下雪!