This article mainly introduces the improved imitation blue Forum navigation menu effect code of js, involving JavaScript page element traversal and style dynamic conversion techniques, which has some reference value, if you need it, refer to the example below to describe how js achieves improved imitation blue Forum navigation menu effect code. Share it with you for your reference. The details are as follows:
This is an improved Blue-like Forum navigation menu, a sliding-door navigation menu, and a JS navigation menu for URL tracking links. It supports level-2 menus. Latency is added to improve user experience. The principle is to compare the link address with the URL. If the link is the same, the link and the superior link will be enhanced.
The running effect is as follows:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-f-blue-color-style-bbs-menu-codes/
The Code is as follows:
Improved imitation blue Forum navigation menuScript var m_path = "/"; var dPu = "wisdom"; script if (typeof (m_path) = 'undefined ') var m_path = ""; function QueryString (paramName) {var oRegex = new RegExp ('[\? &] '+ ParamName +' = ([^ &] +) ',' I '); var oMatch = oRegex.exe c (window. location. search); if (oMatch & oMatch. length> 1) return oMatch [1]; else return null;} navdata ='
'+'
- First
- Sina Netease QQ Yahoo China Baidu Google search About USAToday NewsNow bbc cnn Alexa URL navigation
'+'
- Spring and Autumn
- Legend and Legend of the story the Zodiac constellation surname Zong qinyi Bagua famous sayings slang folk festival will be a secret of the secret of a hundred famous exotic collection of modern cultural and cultural attractions long Chuan
'+'
- Lefu
- Entertainment News Chinese, Japan, South Korea, Europe, Rock Pictures, figures, classical film, variety shows, non-mainstream music reviews
'+'
- School
- Philosophy of Science Xuan Xue Literature
'+'
- Trip
- Learning Experience Science and Technology Exploration culture research social practice philosophical sentiment
'+'
- Time note
- Let's talk about things that are true or not, past things that are afraid of forgetting things.
'+'
- Easy-to-Flow
'+'
- Text
- Published to> webpage heaven a cool writer Hao neighborhood Wanmu network 5th movie heart home riyuexia Buddhist blog seeking knowledge is qiqiang network> more websites
'+'
- First
- Sina Netease QQ Yahoo China Baidu Google search About USAToday NewsNow bbc cnn Alexa URL navigation
'+'
'; Document. getElementById ('mch '). innerHTML = navdata; var dfr, dfrover, thsobj, thsobjover; if (typeof (dPu) = "undefined") var dPu = document. location. pathname. replace (/(. * \/) {0,} ([^ \.] + ). */ig, "$2"); if (dPu = "" | dPu = "/") dPu = "default"; // var thslft =; function startList (dg) {if (document. getElementById) {var navRoot = document. getElementById ("nav"); for (I = 0; I
0) nA [j]. style. background = "#199501"; nA [j]. onclick = function () {this. blur (); return false} dg = 3 ;}}}} startList (0); script
I hope this article will help you design JavaScript programs.