Results 1 to 3 of 3

Thread: need to get sucker tree menu to open to the bottom

  1. #1
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default need to get sucker tree menu to open to the bottom

    1) Script Title: sucker tree

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...menu-vertical/

    3) Describe problem:
    I posted this queston the other day and did not get any response, is there a way to get the menu to open to the bottom, I can get it to go left or right, just not to the bottom. pleas help, also I cannot get the background color of the submenu to change color, it just stays white...

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

    Default

    Hmm can you clarify what you mean by bottom? Bottom relative to what? Also see: http://www.dynamicdrive.com/style/cs...nu-horizontal/

  3. #3
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi thank you for responding here is the code I am using- If i change the java variable to be **style.top or bottom** it opens the sub menus to the top or bottom "relative to the button that has the mosuvoer, but the menu gets all jumbled up. I have the buttons stacked vertically in the menu. Here is what it looks like in html, i will also put the javascript, and css im using as well at the bottom. I am thinking it might be something in the css.


    <div class="suckerdiv">
    <div align="left">
    <ul id="suckertree1">
    <li><a href="#"><img src="/images/icons/arrow_down_green.gif" alt="quick links" width="15" height="15" border="0" align="absmiddle"><span class="arial10greypad">Quick links</span></a>
    <ul>
    <li><a href="http://www.jsr.vccs.edu/curriculum/Default.htm" class="arial10greypad">Academic Courses</a></li>
    <li><a href="http://www.jsr.vccs.edu/curriculum/Default.htm" class="arial10greypad">Course Schedules </a></li>
    </ul>
    </li>
    <li><a href="#"><img src="/images/icons/acadmic_green.gif" alt="degree programs" width="16" height="15" border="0" align="absmiddle"><span class="arial10greypad">Degree programs </span></a>
    <ul>
    <li><a class ="arial10greypad" href="#">Accounting</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    <li><a class ="arial10greypad" href="#">Administration</a></li>
    </ul>
    </li>
    <li><a href="myjsrcc/default.htm" target="new"><img src="/images/icons/blackboard_green.gif" alt="black board" width="16" height="16" border="0" align="absmiddle"><span class="arial10greypad">MyJSRCC email, blackboard...</span></a></li>
    <li><a href="_news/campushappenings.htm"><img src="/images/icons/calander_green.gif" alt="What's Happening at Reynolds" border="0" align="absmiddle" width="16" height="15"><span class="arial10greypad">Campus happenings &amp; photos </span></a></li>
    <li><a href="rss/Reynolds.xml"><img src="/images/icons/rss_green.gif" alt="subscribe to rss" width="15" height="15" border="0" align="absmiddle"><span class="arial10greypad">Subscribe to RSS feeds </span></a></li>
    <li><a href="rss/Reynolds.xml"><img src="/images/icons/sacs_green.gif" alt="Sacs accreditation" width="16" height="15" border="0" align="absmiddle"><span class="arial10greypad">Sacs accreditation</span></a></li>
    </ul>
    </div>
    </div>




    **************then here is the java****************


    <script type="text/javascript">

    //SuckerTree Vertical Menu 1.1 (Nov 8th, 06)
    //By Dynamic Drive: http://www.dynamicdrive.com/style/

    var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

    function buildsubmenus(){
    for (var i=0; i<menuids.length; i++){
    var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
    if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
    ultags[t].style.top=-ultags[t].offsetWidth+"px" //position menu to the bottom of menu item that activated it
    else //else if this is a sub level submenu (ul)
    ultags[t].style.top=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
    for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
    ultags[t].style.visibility="visible"
    ultags[t].style.display="none"
    }
    }
    }

    if (window.addEventListener)
    window.addEventListener("load", buildsubmenus, false)
    else if (window.attachEvent)
    window.attachEvent("onload", buildsubmenus)

    </script>


    **************and the css********************

    <style type="text/css">

    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */

    .suckerdiv ul{
    margin: 0;
    padding: 0;
    list-style-type: none;
    width: 205px;
    border: thick none #CC0033;
    page-break-before:
    display: list-item;
    }

    .suckerdiv ul li{
    position: relative;
    overflow: visible;
    clip: rect(auto,5px,auto,auto);
    }

    /*Sub level menu items */
    .suckerdiv ul li ul{
    position: absolute;
    width: 150px;
    top: 0;
    visibility: hidden;
    background-color: #ffffff;
    float: none;
    overflow: visible;
    border-top: 1px solid #525200;
    border-right: 1px none #525200;
    border-bottom: 1px solid #525200;
    border-left: 1px solid #525200;
    }

    /* Sub level menu links style */
    .suckerdiv ul li a{
    display: block;
    overflow: auto;
    color: black;
    text-decoration: none;
    background: #FFFFFF;<br>
    float: left;
    padding: 1px 5px;
    border-top:
    border-right: 1px none #eeeeee;
    border-bottom: 1px solid #eeeeee;
    border-left: 1px solid #eeeeee;
    }

    .suckerdiv ul li a:visited{
    color: black;
    }

    .suckerdiv ul li a:hover{
    background-color: #FFFFCC;
    }

    .suckerdiv .subfolderstyle{
    background-color: #FFFFFF;
    }


    /* Holly Hack for IE \*/
    * html .suckerdiv ul li {
    float: left;
    height: 1%;
    background-color: #996666;
    }
    * html .suckerdiv ul li a {
    float: left;
    height: 1%;
    background-color: #FFFFFF;
    width: 205px;
    }
    /* End */

    </style>

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
  •