Help tidy up javascript code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fabian

    #1

    Help tidy up javascript code



    Is an index page. I have javascripts to open up submenus. But tehre are
    quiter a lot of them, all simialr. Is there a way to unify all that
    javascript into a single function?


    --
    --
    Fabian
    Visit my website often and for long periods!
    Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.


  • Ang Talunin

    #2
    Re: Help tidy up javascript code

    > http://www.lajzar.co.uk/unit/[color=blue]
    >
    > Is an index page. I have javascripts to open up submenus. But tehre are
    > quiter a lot of them, all simialr. Is there a way to unify all that
    > javascript into a single function?[/color]

    Sure...try this::

    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    #anglo_ok { display: none; }
    </STYLE>
    <SCRIPT LANGUAGE="JavaS cript">
    <!--
    function Show(id1,id2) {document.getEl ementById(id1). style.display =
    "block";documen t.getElementByI d(id2).style.di splay = "none"; return null;}
    function Xejn() { }
    -->
    </SCRIPT>
    </HEAD>
    <BODY>

    <TABLE BORDER WIDTH=100%>
    <TR VALIGN=top><TD WIDTH=33%>

    <DIV ID="anglo_ok">
    <IMG SRC="../icon/hlp2.gif"><A HREF="javascrip t:Xejn()"
    onclick="Show(' anglo_no','angl o_ok')">Anglo-American Units</A><BR><P
    CLASS="ind">
    <IMG SRC="../icon/htm1.gif"><A HREF="system/imp_usa.html">U S
    Customary</A><BR>
    <IMG SRC="../icon/htm1.gif"><A HREF="system/imp_brit.html"> British
    Imperial</A><BR>
    <IMG SRC="../icon/htm1.gif"><A HREF="system/imp_intl.html"> Modern
    International</A><BR>
    <IMG SRC="../icon/htm1.gif"><A HREF="system/imp_scot.html"> Traditional
    Scottish</A><BR>
    <IMG SRC="../icon/htm1.gif"><A HREF="system/imp_eire.html"> Traditional
    Irish</A><BR></P>
    </DIV>
    <DIV ID="anglo_no">
    <IMG SRC="../icon/hlp1.gif"><A HREF="javascrip t:Xejn()"
    onclick="Show(' anglo_ok','angl o_no')">Anglo-American Units</A><BR>
    </DIV>
    </table>

    Please post next time the necesarry code...

    [color=blue]
    > Fabian
    > Visit my website often and for long periods![/color]

    Once and never again...
    [color=blue]
    > http://www.lajzar.co.uk[/color]


    Comment

    • Fabian

      #3
      Re: Help tidy up javascript code


      "Ang Talunin" <please.no.spam @no-reply.com> wrote in message
      news:1065991544 .847831@halkan. kabelfoon.nl...

      [color=blue]
      > Please post next time the necesarry code...[/color]

      Thats why I posted an url.
      [color=blue][color=green]
      > > Fabian
      > > Visit my website often and for long periods![/color]
      >
      > Once and never again...[/color]

      I was going to thank you.


      --
      --
      Fabian
      Visit my website often and for long periods!
      Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.



      Comment

      • Ang Talunin

        #4
        Re: Help tidy up javascript code


        "Fabian" <lajzar@hotmail .com> schreef in bericht
        news:bme4p1$lfm 0p$3@ID-174912.news.uni-berlin.de...[color=blue]
        >
        > "Ang Talunin" <please.no.spam @no-reply.com> wrote in message
        > news:1065991544 .847831@halkan. kabelfoon.nl...
        >
        >[color=green]
        > > Please post next time the necesarry code...[/color]
        >
        > Thats why I posted an url.[/color]

        But if you posted an url, people first have to visit your page...get the
        source,s trip it down to the problem and solve it. If you just post what you
        want to be solved you will get a much faster reaction...


        Comment

        Working...