Animation Javascript将时间间隔添加到我的onmouseover函数中

Animation Javascript将时间间隔添加到我的onmouseover函数中,animation,hover,onmouseover,Animation,Hover,Onmouseover,所以,我有这个标志,我希望它成为彩色鼠标悬停时。我有在鼠标悬停时切换图片的代码,但我需要元素随时间间隔进行更改。你可以在附件中找到我正在使用的代码 <a href="#page-top" class="Logo"><img id="logo" src="img/logocolored1.png" alt="Compositions" onmouseover="hover(this);" onmouseout="unhover(this);" /> <script

所以,我有这个标志,我希望它成为彩色鼠标悬停时。我有在鼠标悬停时切换图片的代码,但我需要元素随时间间隔进行更改。你可以在附件中找到我正在使用的代码

<a href="#page-top" class="Logo"><img id="logo" src="img/logocolored1.png" 
alt="Compositions" onmouseover="hover(this);" onmouseout="unhover(this);" />

<script type="text/javascript">
function hover(element) {
    element.setAttribute('src', 'img/logocolored.png');
                 }
function unhover(element) {
  element.setAttribute('src', 'img/logocolored1.png');                                                
                                        }
</script></a>


你不能把脚本元素放在主持人里面,我的朋友,这不是问题所在,你可以这样做,它也可以工作。@FLash它可能工作,但肯定是错误的,所以不要这样做。特别是当你想从别人那里得到帮助时。@Matyas这可能有用,但肯定是错的。。你要意识到你对编码的看法是多么幼稚。。。。如果行得通,就行。。不要只看你读的书,伙计。@FLash如果你不愿意听,那就不要问:-)用锤子拧螺丝也是可能的,但这并不是一个好的、有效的方法。这一点也不幼稚。我觉得请求帮助和忽视事实是天真的。