问题描述
尝试用图像创建运动,以便图像移动并正确显示。随机移动工作正常,但我无法尝试找出编写 JS 代码的最佳方法。
提前致谢!!!
https://codepen.io/coachFurious/pen/QWGejap
html:
<section>
<article>
<div class="10">
<a class="10" href="10"><img src="https://cyberfishies.com/wp-
content/uploads/2021/03/10.gif"></img></a>
</div>
</article>
</section>
CSS:
div.10{
width: auto;
height: auto;
}
javascript
function randomValues() {
anime({
targets: 'div',translateX: function() {
return anime.random(-10,1400);
},translateY: function() { return anime.random(10,14) + 'rem'; },scale: function() { return anime.random(10,20) / 10; },duration: function() { return anime.random(12000,20000); },easing: 'easeInOutSine',complete: randomValues
});
}
randomValues();
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)