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!