JS implements automatic reading of words (youdao single-word base addition function), and js youdao

Source: Internet
Author: User

JS implements automatic reading of words (youdao single-word base addition function), and js youdao

I am used to youdao for a period of time. It is inconvenient to memorize words, but youdao word customer Duan does not have the automatic reading function, this article uses powerful js to implement simple automatic next word functions,

Method:

Step 1 open the "\ Dict \ 6.3.69.8341 \ resultui \ js \ wordBook. js" file in the youdao path

Add the following code

// Automatic next code var btnStart = document. getElementById ('btn '); var textBox = document. getElementById ('textbox '); var record = 0; var time = null; if (btnStart! = Null) {btnStart. onclick = function () {if (btnStart. value = 'start' & textBox. value! = '') {Timer (); btnStart. value = 'stop';} else if (btnStart. value = 'stop') {clearInterval (time); btnStart. value = 'start' ;}} function timer () {time = setInterval (function () {var mask = document. getElementById ('mask'); var e = document. createEventObject (); if (forget) {// switch the word forget. fireEvent ("onclick", e); location. href = forget. href; mask. fireEvent ('onclick', e); // display definition area if (toggle_description) {description. style. display = "block"; mask. style. display = "none"; if (disable_action) disable_action.style.display = "none"; action. style. display = "block" ;}}}, textBox. value );}

Step 2 open the "\ Dict \ 6.3.69.8341 \ resultui \ wbreview.html" file in the youdao path

Add button and edit box

<! -- Custom control start --> <a style = "font-size: 12px;"> interval setting </a> <input type = "text" style = "width: 50px; "id =" textBox "value =" 1000 "/> <input type =" button "style =" background-color: #6299c5; border: 1px solder #6229c5; color: # fff width: 180px; height: 25px; "id =" btn "value =" Start "/> <! -- Custom control end -->

As shown in the above figure, the JavaScript code is introduced to you to automatically read words (youdao word base is added). I hope it will be helpful to you. If you have any questions, please leave a message for me, the editor will reply to you in time!

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.