here is the link you can watch the left menu here link
here is the code
Expand|Select|Wrap|Line Numbers
- 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.left=(ultags[t].parentNode.offsetWidth-2)+"px" //dynamically position first level submenus to be width of main menu item
- else //else if this is a sub level submenu (ul)
- ultags[t].style.left=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)
Expand|Select|Wrap|Line Numbers
- <?
- function createMenu($parId){
- $q="select
- c.cat_id,
- c.parent_id,
- cd.cat_name
- from
- ".CATEGORY." c,
- ".CATEGORY_DESCRIPTION." cd
- where
- (c.cat_id=cd.cat_id)
- and
- (c.parent_id='$parId')";
- $r=execute($q);
- while($row_cat=mysql_fetch_array($r)){
- $q_s="select c.cat_id, cd.cat_name from ".CATEGORY." c, ".CATEGORY_DESCRIPTION." cd where (c.cat_id=cd.cat_id) and c.parent_id='$row_cat[cat_id]'";
- $r_s=execute($q_s);
- $noRows=mysql_num_rows($r_s);
- if($noRows > 0){?>
- <li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'> <strong>></strong><?php echo " ".$row_cat['cat_name'];?></a>
- <ul>
- <?php createMenu($row_cat['cat_id']);?>
- </ul>
- </li>
- <?php }else{?>
- <li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'><?php echo " ".$row_cat['cat_name'];?></a></li><?php
- }
- }//end while
- }?>
- <tr>
- <td align="center" valign="middle">
- <table cellspacing="0" cellpadding="0" border="0" align="center" width="230" class="menuHeader_left_top ">
- <tr>
- <td align="right" valign="middle" width="40"><img src="images/img-019.png" width="11" height="11" border="0" align="middle" alt="none" /></td>
- <td align="left" valign="middle" class="text_14_grey_dark_bold arrow_bg"> CATEGORY</td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td align="center" valign="middle">
- <table cellspacing="0" cellpadding="0" align="center" width="234">
- <tr>
- <td align="center" valign="middle">
- <table cellspacing="0" cellpadding="0" border="0" align="center" width="234">
- <tr>
- <td align="left" valign="middle" width="234">
- <div class="suckerdiv">
- <ul id="suckertree1">
- <?php
- createMenu(0);
- ?>
- </ul>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
Expand|Select|Wrap|Line Numbers
- /*SUCKER DIV MENU*/
- .suckerdiv ul{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- margin: 0;
- padding: 0;
- list-style-type: none;
- width: 234px; /* Width of Menu Items */
- background: #ffffff;
- z-index:1;
- }
- .suckerdiv ul li{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- position: relative;
- line-height:29px;
- z-index:1;
- }
- /*Sub level menu items */
- .suckerdiv ul li ul{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- position: absolute;
- visibility: hidden;
- width: 234px; /*sub menu width*/
- top: 0;
- z-index:1;
- border:1px solid #ffffff;
- border-top-color:#e8e8e8;
- border-bottom-color:#e8e8e8;
- }
- /* Sub level menu links style */
- .suckerdiv ul li a{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- font-weight:normal;
- display: block;
- overflow: auto; /*force hasLayout in IE7 */
- color:#191c2b;
- text-decoration: none;
- width:232px;
- height:29px;
- z-index:1;
- border:1px solid #ffffff;
- border-right-color:#e8e8e8;
- border-left-color:#e8e8e8;
- background:url(../images/img-014.png) 8px 25px no-repeat;
- }
- .suckerdiv ul li a:visited{
- font-family:Arial, Helvetica, sans-serif;
- font-size: 14px;
- color: #333333;
- }
- .suckerdiv ul li a:hover{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- width:234px;
- height:29px;
- border:1px solid #FFFFFF;
- border-left-color:#e8e8e8;
- /*background-color: #FF9900;background-color: #FFD89C;*/
- }
- .suckerdiv .subfolderstyle{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- background:url(../images/img-014.png) 8px 25px no-repeat;
- z-index:100;
- }
- /* Holly Hack for IE \*/
- * html .suckerdiv ul li { float:left; height: 1%; z-index:2000;}
- * html .suckerdiv ul li a { height: 1%; z-index:2000;}
Omer Aslam