Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help for JavaScript

    Hello!
    I'm new here, and I'm new with JavaScript.
    I found one great script for makeing menus, but I don't know how to make a little change in it.
    I want, when I click on one SubMenu, Mp3s for example, and after than I click on other, Video Clips for example, the opened Mp3s Sub menu, to be closed (when I click on any other, not just on Video Clips).
    I suppose it's simple, but for now I don't have any idea how to make it.
    Please Help me.

    Here is the whole page:
    -------------------------------

    <html>
    <head>
    <meta http-equiv="Content-Language" content="bg">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <META NAME="web design" CONTENT="KILLER Tech">
    <title> Menu</title>
    <style type="text/css">
    body {font-family: Arial; font-size: 8pt;}
    a {text-decoration: none; color: #FFFFFF;}
    a:hover {text-decoration: none; color: #00FF00}
    .child {font-family: Arial; color: #000000; text-decoration:none; display:none}
    .parent {font-family: Arial; color: #000000; text-decoration:none;}
    .item {color: white; text-decoration: none; font-size: 8pt;}
    .biginfo {font-family: Arial; color: #FFFFFF; font-size: 8pt; font-weight: bold;}
    .info {font-family: Arial; color: #FFFFFF; font-size: 7pt; font-weight: bold;}
    .stats {font-family: Arial; font-size:10px; color: white;}
    .statshead {font-family: Arial; font-size:10px; color: white; font-weight: bold;}
    .menu {font: 12px/13px; Times; color: #FFFFFF;}
    .submenu {font: 12px/13px; Times; color: #FFFFFF;}
    .menutitle {font: 12pt; font-family: Arial; font-weight: bold; color: #FFFFFF;}
    BODY {scrollbar-darkshadow-color: #A9A9A9; scrollbar-track-color: #FFFFFF;
    scrollbar-face-color: #000000; scrollbar-arrow-color: #CDCDCD;
    scrollbar-highlight-color: black; scrollbar-3dlight-color: #FFFFFF;
    font-family: Arial; font-size:5pt; }
    </style>

    <script language="JavaScript">
    <!--

    function SymError()
    {
    return true;
    }

    window.onerror = SymError;

    //-->
    </script>

    <script LANGUAGE="JavaScript">
    function expandIt(){return}
    </script>
    <script LANGUAGE="JavaScript1.2">
    function initIt(){
    for(i=0; i<document.getElementsByTagName("DIV").length; i++) {
    if(document.getElementsByTagName("DIV")[i].className == "child") {
    document.getElementsByTagName("DIV")[i].style.display = 'none';}
    }
    }
    function expandIt(el) {
    whichIm = el+"Img"; whichEl = el+"Child"; i=el;
    if (document.getElementById(whichEl).style.display == "none") {
    document.getElementById(whichEl).style.display="block";
    document.getElementById(whichIm).src="minus.bmp";

    }
    else {
    document.getElementById(whichEl).style.display="none";
    document.getElementById(whichIm).src="dot.bmp";
    }
    }

    var correctwidth=1024; var correctheight=768;
    document.write("<STYLE TYPE='text/css'>");
    if (screen.width<correctwidth||screen.height<correctheight) document.write("TR {FONT-SIZE: 10px; FONT-FAMILY: Verdana;}");
    else document.write("TR {FONT-SIZE: 13px; FONT-FAMILY: Verdana;}");
    document.write("</STYLE>");
    </script>
    </head>

    <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="10" bgcolor=#DCDCDC>
    <br><br>
    <table border=5 cellpadding=0 cellspacing=0 align='center' bgcolor='#ffffff'><tr><td>
    <table cellpadding=1 cellspacing=1 border=5 width=160 ><tr><td align='left' bgcolor='#000000'> <center>
    <table border=0><tr><td></td></tr></table>
    <div align="center">
    <table cellpadding=2 cellspacing=0 border=1 width=140 bgcolor="#808080"><tr><td align="center">
    <a class="menutitle" HREF="http://www.killertech.data.bg/main.html" target="contents">
    <font class="menutitle">KILLER Tech</font></a>
    </td></tr></table></div>
    </center>
    <table border=0><tr><td></td></tr></table>
    <table border=0 cellspacing=0 cellpadding=0 align='left'><tr><td align='left'>

    <div ID="el0Parent">
    <a class="submenu" target="contents">
    <img NAME="imEx" SRC="line.bmp" BORDER="0" ALT="KILLER Tech" ID="el0Img">
    </a>
    </div>
    <div ID="el1Parent">
    <a class="menu" HREF="#" onClick="expandIt('el1'); return false;">
    <img NAME="imEx" SRC="dot.bmp" BORDER="0" ALT="Mp3s" ID="el1Img">
    Mp3s</a>
    </div>
    <div ID="el1Child" CLASS="child">
    <div align="center">
    <script language="JavaScript1.2">
    document.write('<a class="item" HREF="/Mp3s/" target="contents">&nbsp;All</a><br>');
    document.write('<a class="item" target="contents">&nbsp;</a><br>');
    document.write('<a class="item" target="contents">&nbsp;<FONT COLOR="#FFD700">-<:=Albums=:>-</FONT></a><br>');
    document.write('<a class="item" target="contents">&nbsp;</a><br>');

    </script>
    </div>
    </div>

    <div ID="el2Parent">
    <a class="submenu" target="contents">
    <img NAME="imEx" SRC="line.bmp" BORDER="0" ALT="KILLER Tech" ID="el2Img">
    </a>
    </div>

    <div ID="el3Parent">
    <a class="menu" HREF="#" onClick="expandIt('el3'); return false;">
    <img NAME="imEx" SRC="dot.bmp" BORDER="0" ALT="Video Clips" ID="el3Img">
    Video Clips</a>
    </div>
    <div ID="el3Child" CLASS="child">
    <div align="center">
    <script language="JavaScript1.2">
    document.write('<a class="item" HREF="/Video%20Clips/" target="contents">&nbsp;All</a><br>');
    document.write('<a class="item" target="contents">&nbsp;</a><br>');
    document.write('<a class="item" target="contents">&nbsp;<FONT COLOR="#FFD700">-<:=Artists=:>-</FONT></a><br>');
    document.write('<a class="item" target="contents">&nbsp;</a><br>');

    </script>
    </div>
    </div>

    <div ID="el4Parent">
    <a class="submenu" target="contents">
    <img NAME="imEx" SRC="line.bmp" BORDER="0" ALT="KILLER Tech" ID="el4Img">
    </a>
    </div>

    <div ID="el5Parent">
    <a class="menu" HREF="#" onClick="expandIt('el5'); return false;">
    <img NAME="imEx" SRC="dot.bmp" BORDER="0" ALT="+" ID="el5Img">
    Wallpapers</a>
    </div>
    <div ID="el5Child" CLASS="child">
    <div align="center">
    <script language="JavaScript1.2">
    document.write('<a class="item" HREF="" target="contents">&nbsp;</a><br>');
    document.write('<a class="item" HREF="/Wallpapers/3D%20Art" target="contents">&nbsp;3D Art</a><br>');
    document.write('<a class="item" HREF="/Wallpapers/Bad%20Boys%202/" target="contents">&nbsp;Bad Boys 2</a><br>');
    document.write('<a class="item" HREF="/Wallpapers/" target="contents">&nbsp;</a><br>');

    </script>
    </div>
    </div>
    </div>
    <div ID="el6Parent">
    <a class="submenu" target="contents">
    <img NAME="imEx" SRC="line.bmp" BORDER="0" ALT="KILLER Tech" ID="el6Img">
    </a>
    </div>


    <br>
    </td>
    </tr>

    <td>
    <div align="center">
    <table border=5><tr><td>
    <div ID="el1007Parent">
    <div align="center">
    <img NAME="imEx" SRC="killer.jpg" BORDER="0" ALT="KILLER Tech" ID="el10071Img">
    </div>
    </div>
    <center>
    <table border=3 bordercolorlight="#00FF00" bordercolordark="#32CD32"><tr><td>
    <A HREF="mailto:killer_tech@abv.bg">killer_tech@abv.bg</A>
    </td></tr></table>
    </center>
    </td></tr></table>
    </div>
    </td>
    </table>

    <script language="JavaScript1.2">
    onload = initIt;
    </script>



    </center>

    </body>
    </html>
    Attached Files Attached Files

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where's the credits?
    That kinda looks like a Brothercake.....

    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •