我使用了snowfall.jquery.min.js JQuery-Snowfall github
它适用于除Safari之外的所有浏览器
如果我使用图像,则显示雪或图像,但没有移动。
这是我的代码:
<body class="darkBg">
<div>Some text here</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src='../dist/snowfall.jquery.min.js'></script>
<script>
$(document).ready(function(){
$(document).snowfall({image :"images/flake.png", minSize: 10, maxSize:32});
});
</script>
</body>
Safari将此突出显示为错误
snowTimeout = requestAnimationFrame(function(){snow()});
snowfall.jquery.js:305ReferenceError: Can't find variable: requestAnimationFrame /* ERROR HERE*/