這是我一直在使用的 JavaScript 代碼。我不斷收到錯誤 ''' cannot set property 'animationplaystate' of undefined. ''' ''' window.setTimeout(function time(){ var run=document.getElementsByClassName('logo'); run.style.animationplaystate='paused'; }, 3000); '''下面是元素的樣式'''.logo{color: rgb(0, 158, 150);float:right;padding-right:0px;font-weight: 600;padding-top:5px;margin-right: 20px;font-size: 2em;padding-left: 30px;animation-name:logo;animation-duration: 1.5s;animation-play-state: running; }'''
如何使用 javascript 在 3 秒的時間間隔后更改 css 屬性?
慕蓋茨4494581
2023-10-17 19:53:43