Results 1 to 4 of 4

Thread: how to make a vertical menu using Chrome CSS Drop Down Menu?

  1. #1
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to make a vertical menu using Chrome CSS Drop Down Menu?

    Script: Chrome CSS Drop Down Menu
    url: http://www.dynamicdrive.com/dynamici...rome/index.htm

    I want to have a vertical menu instead of a horizon one, so I want the pop up menu to display next to the link instead at bottom, so I had tried to change the code, but my change doesn't seems to affect anything..

    Code:
    dropit:function(obj, e, dropmenuID){
    if (this.dropmenuobj!=null) //hide previous menu
    this.dropmenuobj.style.visibility="hidden"
    this.clearhidemenu()
    if (this.ie||this.firefox){
    obj.onmouseout=function(){cssdropdown.delayhidemenu()}
    this.dropmenuobj=document.getElementById(dropmenuID)
    this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
    this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
    this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
    this.showhide(this.dropmenuobj.style, e, "visible", "hidden")
    this.dropmenuobj.x=this.getposOffset(obj, "left")
    this.dropmenuobj.y=this.getposOffset(obj, "top")
    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+1+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+0+"px"
    }
    },
    
    contains_firefox:function(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }

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

    Default

    There's no easy way for this right now. For the moment you can look at: AnyLink vertical menu.

  3. #3
    Join Date
    Mar 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi... i'm new here and im no pro in any field regarding web design.. however, while looking for a method in this forum to enable Chrome CSS to support 3-level menus(if anyone knows pls help me out!), i came across your post and decided to try it out..

    it happens to work but i don't know if there are any implications on other parts of the code but if you're keeping it 2-level i think there shouldnt be a problem... try this... you were right to try to edit that portion of the code.

    Code:
    dropit:function(obj, e, dropmenuID){
    if (this.dropmenuobj!=null) //hide previous menu
    this.dropmenuobj.style.visibility="hidden"
    this.clearhidemenu()
    if (this.ie||this.firefox){
    obj.onmouseout=function(){cssdropdown.delayhidemenu()}
    this.dropmenuobj=document.getElementById(dropmenuID)
    this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
    this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
    this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
    this.showhide(this.dropmenuobj.style, e, "visible", "hidden")
    this.dropmenuobj.x=this.getposOffset(obj, "left")
    this.dropmenuobj.y=this.getposOffset(obj, "top")
    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+obj.offsetWidth+1+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight-23+"px"
    }
    },
    Last edited by d4rk3l; 03-29-2006 at 02:01 PM.

  4. #4
    Join Date
    Oct 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    there is easy way to make chromemenu work as vertical ones
    changes:

    var cssdropdown={
    disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
    disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
    enableswipe: 0, //enable swipe effect? 1 for yes, 0 for no
    vertical_menu: 1,

    and in the the changed drop it function
    dropit:function(obj, e, dropmenuID){
    if (this.dropmenuobj!=null) //hide previous menu
    this.dropmenuobj.style.visibility="hidden" //hide menu
    this.clearhidemenu()
    if (this.ie||this.firefox){
    obj.onmouseout=function(){cssdropdown.delayhidemenu()}
    obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
    this.dropmenuobj=document.getElementById(dropmenuID)
    this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
    this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
    this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
    this.showhide(this.dropmenuobj.style, e)
    this.dropmenuobj.x=this.getposOffset(obj, "left")
    this.dropmenuobj.y=this.getposOffset(obj, "top")
    if (this.vertical_menu)
    {
    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+1+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+1+"px"
    }
    else
    {
    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
    }

    }
    },

    it is for newest chromemenu updated: June 14th, 06'

    Check if it works for you.

    Greets,
    Grabash

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
  •