62 users online (1 members and 61 guests)  

Thread: onclick help


  Results 1 to 4 of 4

Related

  1. Onclick menu - Help    Forum: Javascript Forum
    Replies: 10
  2. onClick and <iframe>    Forum: HTML Forum
    Replies: 4
  3. Onclick Listbox    Forum: Javascript Forum
    Replies: 2
  4. onClick problem    Forum: Javascript Forum
    Replies: 1
  5. onClick on php?    Forum: PHP Forum
    Replies: 1
  1. #1
    Divvy's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    2

    onclick help

    Hi guys!
    I am using this code in my phpBB menu.
    But I need help...
    The menu opens with mouse over and I need to open with onclick

    Can someone help me please?

    Code:
    function init() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("dmenu");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover=function() {
    this.className+=" over";
    }
    node.onmouseout=function() {
    this.className=this.className.replace(" over", "");
    }
    }
    }
    }
    
    }
    Thanks and sorry for my bad english hehe

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: onclick help

    will you give us a domain? or atleast all the html... i have an idea how to, but i'd rather test it.

  3. #3
    Divvy's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    2

    Re: onclick help

    Sure

    Here is the complete mod that I have installed:

    Code:
    ##############################################################
    ## MOD Title: Horizontale Nav-Bar für phpBB 2.0.14
    ## MOD Author: DerEine < webmaster@nat-fan.de > (Stefan) http://www.hilfe.nat-fan.de/forum
    ## MOD Description: Mit dem Mod erstellst Du eine Horizontale Navigations-
    ##                  Leiste in der overall_header.tpl.
    ##                  Die Kategorien und Links können nach belieben erweitert
    ##                  oder verkürzt werden.
    ## MOD Version: 1.0.1
    ## MOD Demo: http://www.board.nat-fan.de
    ##
    ## Installation Level: sehr einfach
    ## Installation Time: 2 Minuten
    ## Files To Edit: 1
    ##                templates/subSilver/overall_header.tpl
    ## Included Files: 1
    ##                 menu.js
    ##############################################################
    ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
    ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    ## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
    ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
    ##############################################################
    ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
    ##############################################################
    #
    #-----[ COPY ]------------------------------------------
    #
    menu.js    >  menu.js
    
    #
    #-----[ OPEN ]------------------------------------------
    #
      templates/subSilver/overall_header.tpl
    
    #
    #-----[ FIND ]------------------------------------------
    #
    /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
    @import url("templates/subSilver/formIE.css");
    
    #
    #-----[ AFTER, ADD ]------------------------------------------
    #
    /* Top-Nav */
    .topmenuul {
    PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
    }
    .topmenuli {
    FLOAT: left; LIST-STYLE-TYPE: none
    }
    .topmenutitle {
    DISPLAY: block; WIDTH: 100px
    }
    .submenuul {
    PADDING-RIGHT: 0px; DISPLAY: none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none; POSITION: absolute
    }
    .submenuli A {
    DISPLAY: block; WIDTH: 100px
    }
    LI:hover UL {DISPLAY: block}
    LI.over UL {DISPLAY: block}
    UNKNOWN {LEFT: auto; TOP: auto}
    .content {CLEAR: left}
    
    #dmenu {
    FONT-SIZE: 11px; FONT-FAMILY: Arial, Helvetica, Sans-Serif
    }
    .topmenuul {}
    .topmenutitle {
    BORDER-RIGHT: #cedcec 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #cedcec 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; BORDER-LEFT: #cedcec 1px solid; COLOR: #000000; TEXT-INDENT: 3px; LINE-HEIGHT: 14px; PADDING-TOP: 3px; BORDER-BOTTOM: #cedcec 1px solid; BACKGROUND-COLOR: #eaedf4; TEXT-DECORATION: none
    }
    .submenuul {
    BORDER-RIGHT: #000000 2px solid; BACKGROUND-POSITION: left top; BORDER-TOP: #000000 1px solid; MARGIN-TOP: -1px; BORDER-LEFT: #cedcec 7px solid; BORDER-BOTTOM: #000000 2px solid; BACKGROUND-REPEAT: repeat-x; BACKGROUND-COLOR: #cedcec
    }
    .submenuli A {
    PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; COLOR: #000000; PADDING-TOP: 3px; BACKGROUND-COLOR: #EFEFEF; TEXT-DECORATION: none
    }
    
    
    .submenuli A:hover {
    COLOR: #000000; BACKGROUND-COLOR: #cedcec; TEXT-DECORATION: none
    }
    #
    #-----[ FIND ]------------------------------------------
    #
    </head>
    
    #
    #-----[ BEFORE, ADD ]------------------------------------------
    #
    <script language="JavaScript" src="menu.js"></SCRIPT>
    
    #
    #-----[ FIND ]------------------------------------------
    #
    <body onload="init();" bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}">
    
    
    #
    #-----[ IN-LINE FIND ]------------------------------------------
    #
    <body
    
    #
    #-----[ IN-LINE AFTER, ADD ]------------------------------------------
    #
     onload="init();"
    
    #
    #-----[ FIND ]------------------------------------------
    #
    <table cellspacing="0" cellpadding="2" border="0">
                   <tr>
                      <td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;
                      <!-- BEGIN switch_user_logged_out -->
                      &nbsp;<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a></span>&nbsp;
                      <!-- END switch_user_logged_out -->
               
                      </td>
                   </tr>
                   <tr>
                      <td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>&nbsp; &nbsp;<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>&nbsp; &nbsp;<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;</span>
    </td>
                   </tr>
                </table>
    
    
    #
    #-----[ REPLACE WITH ]------------------------------------------
    #
    <table cellspacing="0" cellpadding="2" border="0">
                   <tr>
                      <td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
    <!-- BEGIN switch_user_logged_out -->
    <a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a></span>
    <!-- END switch_user_logged_out -->
    <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;
    <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>
    </td>
    </tr>
    </table>
    <table width="100%" align="center">
    <tr>
    <td width="20%"></td>
    <td>
    <ul class="topmenu" id="dmenu">
    <li class="topmenuli"><a class="topmenutitle">Board</a>
    <ul class="submenuul">
    <li class="submenuli"><a href="index.php"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />Forum</a>
    <li class="submenuli"><a href="faq.php"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />FAQ</a>
    </LI>
    </UL>
    </LI>
    <LI class="topmenuli"><a class="topmenutitle">User</A>
    <UL class="submenuul">
    <LI class="submenuli"><a href="{U_PROFILE}"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />Profil</a>
    <LI class="submenuli"><a href="{U_MEMBERLIST}"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />Mitgliederliste</a>
    </LI>
    </UL>
    </LI>
    <li class="topmenuli"><a class="topmenutitle">Interaktiv</a>
    <ul class="submenuul">
    <li class="submenuli"><a href="{U_SEARCH}"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>
    </LI>
    </UL>
    </LI>
    <li class="topmenuli"><a class="topmenutitle">Your Text</a>
    <ul class="submenuul">
    <li class="submenuli"><a href="#">...</a>
    <li class="submenuli"><a href="#">...</a>
    <li class="submenuli"><a href="#">...</a>
    <li class="submenuli"><a href="#">...</a>
    </LI>
    </UL>
    </LI>
    <li class="topmenuli"><a class="topmenutitle">Your Text</a>
    <ul class="submenuul">
    <li class="submenuli"><a href="#">...</a>
    <li class="submenuli"><a href="#">...</a>
    <li class="submenuli"><a href="#">...</a>
    </LI>
    </UL>
    </LI>
    </UL>
    </td></tr>
    </table>
    <div class="content">
    
    
    
    #
    #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: onclick help

    try this:
    Code:
    function init() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("dmenu");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseclick=function() {
    this.className+=" over";
    }
    node.onmouseout=function() {
    this.className=this.className.replace(" over", "");
    }
    }
    }
    }
    
    }
    like i said, if you had a website where i could get all the html/js i could help much eassier.



Tags for this Thread