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.