About Baidu Music Box

Source: Internet
Author: User

Recently like to use the Baidu Music box to listen to music, but there is a human egg pain problem: Every time the current song playback end of the next song will occasionally be interrupted a voice ad ...

Just look at the script.

1         functionFrandomby (under, over) {2         Switch(arguments.length) {3              Case1:returnparseint (Math.random () *under+1);4              Case2:returnparseint (Math.random () * (over-under+1) +under);5             default:return0;6             }7         } 8$(function(){9SetInterval (function(){Ten             if($ ('. Curtime '). Text (). replace ("00:00", "") ==$ ('. TotalTime '). Text (). substr (0,$ ('. TotalTime '). Text (). length-1) + "0 "){ One                 varCursong=frandomby (1,$ ('. Playlist-length '). Text (). Replace (/\d/g, ")); A Console.log (cursong); -$ (' div[reellist-row= ' +cursong+ ') '). DblClick () -         } the},1000) -})
View Code

Practice: A song in a random playlist before the end of the current song play.

function: Take interval random number

The SetInterval function is written in $ (function () {}) because the page reload when the next song is played.

<OVER>

About Baidu Music Box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.