Some important content on the js script page with a highlighted element needs to be reminded to the customer. There are many methods available. Remind the user to pay attention to a certain area (p). You can add the frame flashing effect to the p to attract the user's attention.
<Script language = "javascript" type = "text/javascript"> <! --/* Common function library --- start --- */function $ (objString) {return document. getElementById (objString);} function addClass (elem, classString) {if (typeof (elem) = "string") var obj = document. getElementById (elem); else if (typeof (elem) = "object") var obj = elem; obj. className = obj. className + "" + classString;} function removeClass (elem, classString) {if (typeof (elem) = "string") var obj = document. getElementById (elem ); Else if (typeof (elem) = "object") var obj = elem; var classNameArray = obj. className. split (""); for (I = 0; j = classNameArray [I]; I ++) {if (j = classString) {classNameArray. splice (I, 1); I --;} obj. className = classNameArray. join ("");} function hasClass (elem, classString) {if (typeof (elem) = "string") {var obj = document. getElementById (elem);} else if (typeof (elem) = "object") {var obj = elem;} if (obj. ClassName. indexOf ("")! =-1) {var cls = obj. className. replace (// g, "|"); cls = "|" + cls + "|"; if (cls. indexOf ("|" + classString + "| ")! =-1) {return true;} else {return false} else {if (obj. className = classString) {return true;} else {return false ;}}/ * Common function libraries --- end --- */function highLight (obj) {if (obj. highlightHandel! = Null) return; obj. highlightHandel = setInterval (function () {twinkle (obj) }, 250);} function twinkle (objBox) {hasClass (objBox, "highLight ")? RemoveClass (objBox, "highLight"): addClass (objBox, "highLight");} function stopTwinkle (obj) {clearInterval (obj. highlightHandel); removeClass (obj, "highLight"); obj. removeAttribute ("highlightHandel");} // --> script <style>. box {border: 1px solid # ccc; height: 100px; width: 600px; text-align: center; line-height: 100px; background-color: # f7f7f7 }. highLight {background-color: # ffffcc; border: 1px solid # f30} </style> <p id = "demo" class = "box"> Box I </p> <input type = "button" value = "blinking" onclick = "highLight ($ ('Demo ')) "/> <input type =" button "value =" stop "onclick =" stopTwinkle ($ ('Demo ')) "/> <p id =" demo2 "class =" box "> Box II </p> <input type =" button "value =" blinking "onclick =" highLight ($ ('demo2 ')) "/> <input type =" button "value =" stop "onclick =" stopTwinkle ($ ('demo2') "/>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The Code contains several common functions (separated by comments), which can be replaced by methods in prototype. js. The following functions can be slightly modified and run.