我的項目7 js 實現歌詞同步(額,小小的效果),

來源:互聯網
上載者:User

我的項目7 js 實現歌詞同步(額,小小的效果),

在項目中需要做一個播放器,還要實現歌詞同步的效果,就跟現在搜狗音樂的歌詞同步差不多,在網上查了一些關於這方面的,整理了一下,在這裡,其實用這個方法可以嗎?

<!DOCTYPE html><html><head><meta charset="utf-8" /><title></title><script type="text/javascript" src="js/jquery.min.js" ></script><script type="text/javascript">window.setInterval("dd()",200);var i=0;function dd(){i=i+10;//alert(i)document.getElementById("mydiv2").style.width=i+"px"; }function x(){//alert("-----")document.getElementById("mydiv2").style.color="red";}</script></head><body>        <div class="mydiv1" style="position: absolute; z-index: 1;">        <h1>影月瑩瑩哈哈哈哈哈哈</h1>        </div>        <div  class="mydiv2" id="mydiv2" style="position: absolute; z-index:2; color: blue; width: 100px; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">        <h1>影月瑩瑩哈哈哈哈哈哈</h1>        </div>        <button id="mybutton" onclick="x()" style="height: 100px; width: 200px; margin-top: 100px;">電機 </button></body></html>
在這裡,,我用了一個這種方法,不知行不行的通 ,,至於歌詞同步,就調時間吧,向網上一些部落格,,看了都是需要AJAX解析歌曲檔案,擷取歌詞,歌詞時間,實現歌詞同步,在這裡,如果只是一兩首歌曲,自己調一調時間也行吧。。。。,至於大家有什麼看法。。額額。。。嘿嘿




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.