Results 1 to 4 of 4

Thread: Smart Menu Folding Tree

  1. #1
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Smart Menu Folding Tree

    re:http://dynamicdrive.com/dynamicindex1/navigate1.htm

    Hi I'm new here and I've been trying to use this script,
    on multiintech the menu works great.
    I've made some changes to make it appear open when you first visit. the only thing is I want to change the background image to have an arrow point right when closed and down when open like this example, that script is ok and I figured out how to move the arrow where I want it ..but I didn't try to figure out how to make it show open on first visit,, besides I like the folding tree better
    Thanks to any help I can get.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The problem is that you use a single image for the whole thing. Firstly, use a single blank image; write the text on over the top. That's what background images are for. If you just use two image elements - a blank menu background and an arrow - then add text on over the top, you save bandwidth and make your site more accessible. Secondly, use two different images for the menu background and the arrow.
    Do this, then post back.

    P.S. I hope Apple don't decide to sue over Aqua
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply.
    I tried using text over the image but every time it would put the text next to or after the image. this script is looking for a open or closed folder image next to it. so I tried to just use changing back ground images,,no luck. this is the script so far,, I have 2 diff. images 1 for arrow right 1 for arrow down but I can't seem to pull them in?
    ps. that is a screen shot from my desk, chooped up and put back together in pieces, I'm using a theme hack to make it look like OSX.

    <!--
    //Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
    //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    //This credit MUST stay intact for use

    var head="display:''"
    img1=new Image()
    img1.src="menuhead1.jpg"
    img2=new Image()
    img2.src="menuhead2.jpg"

    var ns6=(document.getElementById&&!document.all||window.opera)
    var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

    function checkcontained(e){
    var iscontained=0
    cur=ns6? e.target : event.srcElement
    i=0
    if (cur.id=="nahead")
    iscontained=1
    else
    while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
    if (cur.id=="nahead"||cur.id=="foldinglist"){
    iscontained=(cur.id=="nahead")? 1 : 0
    break
    }
    cur=ns6? cur.parentNode : cur.parentElement
    }

    if (iscontained){
    var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("DIV")[0]
    if (foldercontent.style.display=="none"){
    foldercontent.style.display=""
    cur.style.divStyleImage="url(menuhead2.jpg)"
    }
    else{
    foldercontent.style.display="none"
    cur.style.divStyleImage="url(menuhead1.jpg)"
    }
    }
    }

    if (ie4||ns6)
    document.onclick=checkcontained
    ///
    function get_cookie(Name) {
    //Get cookie routine by Shelley Powers
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) {
    offset += search.length
    // set index of beginning of value
    end = document.cookie.indexOf(";", offset);
    // set index of end of cookie value
    if (end == -1) end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }

    var foldercontentarray=new Array()
    var c=0

    if (ns6){
    for (i=0;i<document.getElementsByTagName("UL").length;i++){
    if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
    foldercontentarray[c]=document.getElementsByTagName("UL")[i]
    c++
    }
    }
    }

  4. #4
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Weeee MultiInTech
    I guess with enuf hackin you can get somethin done.
    I just have to get a few more things active,,like the address bar, search, folder, maybe a style sheet changer from the view button,, now if I could just get it to show up in IE nicley i'll be doin good
    Last edited by maksbud; 01-24-2006 at 05:52 AM.

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
  •