<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Lowyat.NET: Latest topics by GaRNeT</title>
        <description></description>
        <link>http://forum.lowyat.net/</link>
        <lastBuildDate>Mon, 13 Jul 2026 16:04:30 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Javascript Menu</title>
            <link>http://forum.lowyat.net/topic/424135</link>
            <description>Hi, I want to create a menu that use arrows as bullets. The menu is supposed to have several layers of menu under it. So, when i clicked the menu the arrow is supposed to change into another arrow and when i close up the switch menu, the arrow will return to normal. Now, how do i alternate the pictures of arrow to suit my needs? I am not very familiar with javascript fyi. I found a way to flip it once but then how do i flip it back. here is the code for the flipping part:&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;function flip&amp;#40;&amp;#41; {&lt;br /&gt; &amp;nbsp; &amp;nbsp;if &amp;#40;document.images&amp;#41;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;document.images&amp;#91;&amp;#39;image1&amp;#39;&amp;#93;.src = &amp;#39;image2.gif&amp;#39;;&lt;br /&gt;}&lt;br /&gt;&amp;#60;a href=&amp;#34;#&amp;#34; onClick=&amp;#34;flip&amp;#40;&amp;#41;;return false&amp;#34;&amp;#62;&amp;#60;img src=&amp;#34;image1.gif&amp;#34; name=&amp;#34;image1&amp;#34; width=&amp;#34;100&amp;#34; height=&amp;#34;100&amp;#34; border=&amp;#34;0&amp;#34;&amp;#62;&amp;#60;/a&amp;#62;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;Then, another question. When I clicked a menu to open the respective page, how do i make the selected menu different. I mean like bold or colouring. I know how to change the appearane. But then how can i make the changes temporary only. After i clicked another link at the menu, the previous selected menu revert back to normal and the newly selected one change? I think this involves css and javascript but i can&amp;#39;t seem to figure out how. an example on the internet can be seen here :&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.htmldog.com/' target='_blank'&gt;&lt;span style='color:red'&gt;change menu appearance&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;check out its menu at the side. i want to make it into something like that.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.w3schools.com/js/tryit.asp?filename=try_dom_image_src' target='_blank'&gt;&lt;span style='color:red'&gt;Change picture&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;something like that instead i  want to use arrows that can be reverted back to normal. as you can see the example only works one way. &lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;&lt;br /&gt;[addedon]March 9, 2007, 4:01 pm[/addedon]Hi all sorry for troubling you guys... but my friend eventually managed to explain the first part of my problem to me and solved it. So now it only leaves me with the second problem. Just in case anyone wondering the solution, here it is:&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;function changeSrc&amp;#40;&amp;#41;&lt;br /&gt; &amp;nbsp;{&lt;br /&gt; &amp;nbsp;var control = document.getElementById&amp;#40;&amp;#34;control&amp;#34;&amp;#41;.value&lt;br /&gt; &amp;nbsp;if &amp;#40;control == &amp;#34;0&amp;#34;&amp;#41;{&lt;br /&gt; &amp;nbsp;document.getElementById&amp;#40;&amp;#34;myImage&amp;#34;&amp;#41;.src=&amp;#34;hackanm.gif&amp;#34;&lt;br /&gt; &amp;nbsp;document.getElementById&amp;#40;&amp;#34;control&amp;#34;&amp;#41;.value=&amp;#34;1&amp;#34;}&lt;br /&gt; &amp;nbsp;else {&lt;br /&gt; &amp;nbsp;document.getElementById&amp;#40;&amp;#34;myImage&amp;#34;&amp;#41;.src=&amp;#34;compman.gif&amp;#34;&lt;br /&gt; &amp;nbsp;document.getElementById&amp;#40;&amp;#34;control&amp;#34;&amp;#41;.value=&amp;#34;0&amp;#34;}&lt;br /&gt; &amp;nbsp;}&lt;br /&gt;function setControlValue&amp;#40;&amp;#41;&lt;br /&gt; &amp;nbsp;{ document.getElementById&amp;#40;&amp;#34;control&amp;#34;&amp;#41;.value = &amp;#34;0&amp;#34; }&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;body onload=&amp;#34;setControlValue&amp;#40;&amp;#41;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;img id=&amp;#34;myImage&amp;#34; src=&amp;#34; compman.gif&amp;#34; width=&amp;#34;107&amp;#34; height=&amp;#34;98&amp;#34; /&amp;#62;&lt;br /&gt;&amp;#60;br /&amp;#62;&amp;#60;br /&amp;#62;&lt;br /&gt;&amp;#60;input id=&amp;#34;control&amp;#34; type=&amp;#34;hidden&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;input type=&amp;#34;button&amp;#34; onclick=&amp;#34;changeSrc&amp;#40;&amp;#41;&amp;#34; value=&amp;#34;Change image&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;Thanks anyway, but i still got another problem. Maybe i&amp;#39;ll try to solve it in a similar way to the first one. I&amp;#39;ll post here if i found the solution. In the mean time, if you already have the solution, please feel free to post. Thanks.</description>
            <author>GaRNeT</author>
            <category>Codemasters</category>
            <pubDate>Fri, 09 Mar 2007 15:09:28 +0800</pubDate>
        </item>
    </channel>
</rss>
