Javascript Menus



  • Thankfully, I ran across this javascript menu and didn't have to manipulate it any but heres a clip of the source code:

           if (aV7Nav[i][3].length && aV7Nav[i][2]) {

            for(j=0;j<aV7Nav[i][3].length;j++) {

                if (aV7Nav[i][3][j][0].length > 13 && aV7Nav[i][3][j][0].length < 24) {// add line break so mouse over bolding doesnt break

           sTmp = aV7Nav[i][3][j][0].substr(0,aV7Nav[i][3][j][0].lastIndexOf(' ')) + "<br />" + aV7Nav[i][3][j][0].substr(aV7Nav[i][3][j][0].lastIndexOf(' '), aV7Nav[i][3][j][0].length);

           aV7Nav[i][3][j][0] = sTmp;

          }

    Heres another clip:

              sSubsection += ' onClick="location.href=&#39;'+aV7Nav[i][3][j][1]+'&#39;">';

              sSubsection += (aV7Nav[i][3][j][2] ? '<img src="/res/images/bullseye/leftnav/arrow4.gif" width="4" height="7" alt="" />&nbsp;' : '')+aV7Nav[i][3][j][0]+'</div>';

              // 3rd level

              if (aV7Nav[i][3][j][2] && aV7Nav[i][3][j][3] ) {

               for(k=0;k<aV7Nav[i][3][j][3].length;k++){

                   if(aV7Nav[i][3][j][3][k][0].length > 0) {

                    if ( (k == aV7Nav[i][3][j][3].length - 1) && (j == aV7Nav[i][3].length - 1)) {

                     //last 3rd level on last 2nd level, so base of a menu

                     sCss = "nwcLast"; sCssOn = "nwcoLast";

                     if (aV7Nav[i][3][j][3][k][0].length >= 15) {sCss = "nwcLastTall"; sCssOn = "nwcoLastTall";}

                     if (aV7Nav[i][3][j][3][k][0].length > 35 || (aV7Nav[i][3][j][3][k][0].length > 25 && aV7Nav[i][3][j][3][k][2]) || navigator.appVersion.indexOf("Mac") > -1 && aV7Nav[i][3][j][3][k][0].length > 30) {sCss = "nwcLastTall3Line"; sCssOn = "nwcoLastTall3Line";}

                     sSubsection += '<div class="' + sCss + '" '+(aV7Nav[i][3][j][3][k][2] ? ' style='font-weight:bold;text-decoration:none;'' : '' )+' onMouseOver='this.className='' + sCssOn + ''' onMouseOut='this.className='' + sCss + ''' onClick='location.href=''+aV7Nav[i][3][j][3][k][1]+'''>'+aV7Nav[i][3][j][3][k][0]+'</div>';

                    } else sSubsection += '<div class="nwc" '+(aV7Nav[i][3][j][3][k][2] ? ' style='font-weight:bold;text-decoration:none;'' : '' )+' onMouseOver='this.className='nwco'' onMouseOut='this.className='nwc'' onClick='location.href=''+aV7Nav[i][3][j][3][k][1]+'''>'+aV7Nav[i][3][j][3][k][0]+'</div>';

                }

                  }

                 }

    Theres about 3 pages of it like this... check it out yourself: http://www.bigpond.com/res/javascript/header.js



  • Yuck... that's pretty nasty..

    Though I have to admit that it looks like something I could have done five years ago..

    <font size="2">

     

    </font>



  • I think I may or may not have had to work with this code once.

    It may or may not have been associated with a large Australian (or not) telco, for a different client with a site that had to match that navigational style.

    It is entirely possible that someone, who may or may not have been me, had to change the contents of the menus plus do a bit of layout work, the kind of job one might expect to spend less than an hour on coding, but it ends up taking a couple of days.

    Why did you have to remind me? Why?



  • that seems generated to me..like one of those javascript menu creator apps you see all over the place


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.