Results 1 to 8 of 8

Thread: Slide Bar Menu

  1. #1
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Slide Bar Menu

    I was just wondering if the is a way to put "alt text" or a mouse over "title" in
    the slide bar menu html. I used the slide bar in a web page and just love it.
    It does what I need and isn't in the way after it's used. Can you help me out ??
    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm which slide bar script are you referring to? That's why it's always important to include a link to it on our site per the posting guidelines: http://www.dynamicdrive.com/forums/showthread.php?t=6

  3. #3
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I would have, but it's on a secure intranet site for Fedex so you couldn't log onto it anyway. Here is the script as it appears on the site.
    Thanks

    <script language="JavaScript1.2">

    /***********************************************
    * Sliding Menu Bar Script- © Dynamic Drive (www.dynamicdrive.com)
    * Visit http://www.dynamicdrive.com/ for full source code
    * This notice must stay intact for use
    ***********************************************/

    var slidemenu_width=160 //specify width of menu (in pixels)
    var slidemenu_reveal=12 //specify amount that menu should protrude initially
    var slidemenu_top=220 //specify vertical offset of menu on page

    var ns4=document.layers?1:0
    var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
    var ns6=document.getElementById&&!document.all?1:0

    if (ie4||ns6)
    document.write('<div id="slidemenubar2" style="left:'+((slidemenu_width-slidemenu_reveal)*-1)+'; top:'+slidemenu_top+'; width:'+slidemenu_width+'" onMouseover="pull()" onMouseout="draw()">')
    else if (ns4){
    document.write('<style>\n#slidemenubar{\nwidth:'+slidemenu_width+';}\n<\/style>\n')
    document.write('<layer id="slidemenubar" left=0 top='+slidemenu_top+' width='+slidemenu_width+' onMouseover="pull()" onMouseout="draw()" visibility=hide>')
    }

    var sitems=new Array()

    ///////////Edit below/////////////////////////////////

    //siteitems[x]=["Item Text", "Optional URL associated with text"]


    sitems[0]=["<big><font face='Arial'>Site Menu</font></big>", ""]
    sitems[1]=["Ariba","https://ariba.fedex.com/Buyer/Main/ad/loginPage/SSOActions?awsso_cc=Ariba%3AICAgICAgICAgICBBUklCQSAgICAgICAgICA%3D%3Bawsso_ru%3AaHR0cHM6Ly9hcmliYS5mZWRleC5jb20vQnV5ZXIvTWFpbj9BcmliYT0rKysrKysrKysrK0FSSUJBKysr KysrKysrKw%3D%3D%3Bawsso_lu%3AaHR0cHM6Ly9hcmliYS5mZWRleC5jb20vQnV5ZXIvTWFpbi9hZC9jbGllbnRMb2dvdXQvU1NPQWN0aW9ucz9hd3NyPXRydWU%3D%3Bawsso_ap%3AQnV5ZXI%3D%3Bawsso _arid%3AMTA3NjAwNzA5NzgzMg%3D%3D%3Bawsso_fl%3AMQ%3D%3D&awsso_ap=Buyer&awsr=true"]
    sitems[2]=["A.S.E.","http://www.asecert.org/"]
    sitems[3]=["Austin-Thomas","http://fedexparts.austinhardware.com"]
    sitems[4]=["Benefits","http://hronline.corp.fedex.com/benefits/benweb/index.shtml"]
    sitems[5]=["Benefit Forms","http://hronline.corp.fedex.com/benefits/benweb/forms.shtml?Employee%20Benefit%20Forms=Employee%20Benefit%20Forms"]
    sitems[6]=["C.B.T","https://npadmin.prod.fedex.com:8443/en/login.html"]
    sitems[7]=["Central Region","http://isp1.telecom.fedex.com/~cr-vmx"]
    sitems[8]=["Comail","http://home.fedex.com/Directory/comail.html"]
    sitems[9]=["Famis Manual","http://famis.web.fedex.com/famis/manual/index.cfm"]
    sitems[10]=["Fedex Library","http://library.fedex.com/library/Divisions/veh.htm"]
    sitems[11]=["Fleet Decals","http://fedexbrand.com/fedexfleet/index.asp"]
    sitems[12]=["Freightliner Manuals","http://trucks.field.fedex.com/Freightliner.htm"]
    sitems[13]=["GSE Manuals","http://vmars-app.lhsprod.fedex.com/equip_main.htm"]
    sitems[14]=["IL. DOT","http://www.dot.state.il.us"]
    sitems[15]=["IN. DOT","http://www.IN.gov/dot/?INDIANA DOT"]
    sitems[16]=["Pennzoil MSDS","http://www.pzlqs.com/techdata/msds/msds.asp"]
    sitems[17]=["Safety Manual","http://library.fedex.com/library/corporate/safety/index.htm"]
    sitems[18]=["Ship Manager","https://www.fedex.com/fcl/web/jsp/logon.jsp?appName=fclfsm&locale=us_en&step3URL=https%3A%2F%2Fwww.fedex.com%2Fcgi-bin%2Fship_it%2FinterNetShip%3Flink%3D1%26origincountry%3Dus%26locallang%3Dus%26urlparams%3Dus%26sType%3D%26action%3Dfsmregister&returnurl=https%3A%2F%2Fwww.fed ex.com%2Fcgi-bin%2Fship_it%2FinterNetShip%3Flink%3D1%26origincountry%3Dus%26locallang%3Dus%26urlparams%3Dus%26sType%3D&programIndicator=0"]
    sitems[19]=["Shop Floor","http://sfs.web.fedex.com/SFS/Logon/Logon.jsp"]
    sitems[20]=["Sprinter","http://fleet.daimlerchrysler-vans.com"]
    sitems[21]=["Sprinter Tech Tips","http://isp1.telecom.fedex.com/~convehmx/convehmx/sprinter_tech_tip_pages.html"]
    sitems[22]=["Supplier Sites","http://isp1.intranet.fedex.com/~vehgsemx/Supplier_main.htm?Vendors=%20%20%20%20%20%20%20%20%20%20%20%20Vendors"]
    sitems[23]=["Techtalk","http://isp1.intranet.fedex.com/~vehgsemx/techtalk_main.htm"]
    sitems[24]=["Tire Manual","http://library.fedex.com/library/vehmx/tires/index.htm?Tire%20Manual=%20%20%20%20%20%20%20Tire%20Manual"]
    sitems[25]=["TSB's & C/D's","http://isp1.intranet.fedex.com/~vehgsemx/cd-tsb_main.htm?Ariba=CAMPAIGN++DIRECTIVES+and+TECHNICAL++SERVICE++BULLETINS"]
    sitems[26]=["Vehicle/GSE","http://vmars-app.lhsprod.fedex.com"]
    sitems[27]=["Vehicle Retirement Form","http://199.82.140.145/vmrs/forms/retirement.cfm"]
    sitems[28]=["Warranty","http://vmars-app.lhsprod.fedex.com/reporting_portal/vmarsReporting.html"]
    sitems[29]=["Web mail","http://web.mail.fedex.com/"]

    //If you want the links to load in another frame/window, specify name of target (ie: target="_new")
    var target=""

    /////////////////////////////////////////////////////////

    if (ie4||ns4||ns6){
    for (i=0;i<sitems.length;i++){
    if (sitems[i][1])
    document.write('<a href="'+sitems[i][1]+'" target="'+target+'">')
    document.write(sitems[i][0])
    if (sitems[i][1])
    document.write('</a>')
    document.write('<br>\n')
    }
    }

    function regenerate(){
    window.location.reload()
    }
    function regenerate2(){
    if (ns4){
    document.slidemenubar.left=((slidemenu_width-slidemenu_reveal)*-1)
    document.slidemenubar.visibility="show"
    setTimeout("window.onresize=regenerate",400)
    }
    }
    window.onload=regenerate2

    rightboundary=0
    leftboundary=(slidemenu_width-slidemenu_reveal)*-1

    if (ie4||ns6){
    document.write('</div>')
    themenu=(ns6)? document.getElementById("slidemenubar2").style : document.all.slidemenubar2.style
    }
    else if (ns4){
    document.write('</layer>')
    themenu=document.layers.slidemenubar
    }

    function pull(){
    if (window.drawit)
    clearInterval(drawit)
    pullit=setInterval("pullengine()",10)
    }
    function draw(){
    clearInterval(pullit)
    drawit=setInterval("drawengine()",10)
    }
    function pullengine(){
    if ((ie4||ns6)&&parseInt(themenu.left)<rightboundary)
    themenu.left=parseInt(themenu.left)+10
    else if(ns4&&themenu.left<rightboundary)
    themenu.left+=10
    else if (window.pullit){
    themenu.left=0
    clearInterval(pullit)
    }
    }

    function drawengine(){
    if ((ie4||ns6)&&parseInt(themenu.left)>leftboundary)
    themenu.left=parseInt(themenu.left)-10
    else if(ns4&&themenu.left>leftboundary)
    themenu.left-=10
    else if (window.drawit){
    themenu.left=leftboundary
    clearInterval(drawit)
    }
    }
    </script>

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi:
    Well, to add an alt text (or "title" attribute to each menu item), do the following:

    1) Extend each array element with a 3 parameter:

    sitems[2]=["A.S.E.","http://www.asecert.org/", "Title for this link"]

    Then, modify the lines:

    if (sitems[i][1])
    document.write('<a href="'+sitems[i][1]+'" target="'+target+'">')

    so it reads instead:

    if (sitems[i][1])
    document.write('<a href="'+sitems[i][1]+'" target="'+target+'" title="'+sitems[i][2]+'">')

    That should do it.

  5. #5
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You lost me, where does this get inserted ?? Anywhere I try it
    the slide bar dissappears. Can you give me an example of exactly where it goes using the line from site item 1
    Thanks

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi:
    For 1), simply change all the array elements so they contain a third parameter, such as from:

    sitems[2]=["A.S.E.","http://www.asecert.org/"]

    to:

    sitems[2]=["A.S.E.","http://www.asecert.org/", "Title for this link"]

    For 2), as mentioned, locate the exact lines as mentioned, and modify it as such to the changed version.

  7. #7
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I gotcha !! I just wasn't looking far enough up in the code to locate the
    lines I need to change.

    Thanks a bunch

  8. #8
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That works really slick. I appreciate the help.
    You guys are all right !!
    Thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •