473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Toggle image on onclick event

I have to toggle the arrow image on onclick event. Here is the code with the required functionility. What I want now is, when the page loads there will be right arrow images. The arrow should be chenge to down arrow when I the row expands to dispaly the child links. and if the collaps to hide child link the arrow should change back to right arroe image. In the below e.g code you will not be able to see the arrow images.
Here is the code I have.
CODE:

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
//code for toggling-hide/display table
function ShowMenu(num,menu,max,imd)
{
//alert('test toggle');
for(i = 0; i < max; i++)
{

//add number onto end of menu
var menu_div = menu + i;
//var menu_div1 = menu1 + i;
//if current show
if(i == num)
{
document.getElementById(menu_div).style.display = 'inline';
//document.getElementById(menu_div1).style.display = 'block';

}
else
{
//if not, hide
document.getElementById(menu_div).style.display = 'none';

//document.getElementById(menu_div1).style.display = 'none';
}


}

}
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td colspan=3><img src="/virtuals/vap/CWW/images/spacer.gif" height=15 width=1></td>
</tr>
<tr>
<td width=15><img src="/virtuals/vap/CWW/images/spacer.gif" height=1 width=15></td>
<td "width=100%">

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#DDDDDD" width="100%" id="AutoNumber5" bgcolor=#DDDDDD>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6">
<tr>
<td width="100%">
<table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber7" width="100%">
<tr>
<td valign="top" width="1"></td>

<td><b><font size="2" face="Tahoma" color="black">
<span style="font-size: 8pt">FAVORITE LINKS</span></font></b>
</td>

</tr>
</table>
</td>
</tr>

<tr>
<td width="100%" bgcolor="#FFFFFF">

<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber8">
<tr>
<td width ="100%">
<table width="100%" border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber10" height="30" >



<tr>
<td width="10%" align ="left" width="" valign="middle"><a style="cursor:hand" onclick="ShowMenu('0','row','3','img0')"><img id='img0' src="/virtuals/vap/CWW/images/grey_arrow_right.jpg" height="13" width="13" alt="right arrow"></a></td>
<td width="100%" valign="top"><font style="font-size: 7pt" face="Tahoma"><b>TOP LINKS</b></font></td>
</tr>
<tr id='row0' style="display:none;"><td colspan="2">
<span><table width="100%" border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse">


<tr>
<td width="10%"></td>
<td width="100%" valign="top"><a href="HTTP://expense6.bmc.com/eworkplace" class="bodyText"><font style="font-size: 8pt" face="Tahoma">Expense Reports</font></a></td>
</tr>



<tr>
<td width="10%"></td>
<td width="100%" valign="top"><a href="HTTP://sharepoint.bmc.com/GlobalTravel/default.aspx" class="bodyText"><font style="font-size: 8pt" face="Tahoma">Travel</font></a></td>
</tr>



</table>
</span>
</td>
</tr>

<tr>
<td colspan="2" width="100%">
<hr color="#dddddd" size="1" />
</td>
</tr>

<tr>
<td width="10%" align ="left" width="" valign="middle"><a style="cursor:hand" onclick="ShowMenu('1','row','3','img1')"><img id='img1' src="/virtuals/vap/CWW/images/grey_arrow_right.jpg" height="13" width="13"></a></td>
<td width="100%" valign="top"><font style="font-size: 7pt" face="Tahoma"><b>GET IT DONE</b></font></td>
</tr>
<tr id='row1' style="display:none;"><td colspan="2">
<span><table width="100%" border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse">


<tr>
<td width="10%"></td>
<td width="100%" valign="top"><a href="HTTPS://ncai.bmc.com:9440/OA_HTML/US/OCAIPROD_login.htm" class="bodyText"><font style="font-size: 8pt" face="Tahoma">Oracle Login</font></a></td>
</tr>



</table>
</span>
</td>
</tr>

<tr>
<td colspan="2" width="100%">
<hr color="#dddddd" size="1" />
</td>
</tr>

<tr>
<td width="10%" align ="left" width="" valign="middle"><a style="cursor:hand" onclick="ShowMenu('2','row','3','img2')"><img id='img2' src="/virtuals/vap/CWW/images/grey_arrow_right.jpg" height="13" width="13"></a></td>
<td width="100%" valign="top"><font style="font-size: 7pt" face="Tahoma"><b>CORPORATE</b></font></td>
</tr>
<tr id='row2' style="display:none;"><td colspan="2">
<span><table width="100%" border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse">


<tr>
<td width="10%"></td>
<td width="100%" valign="top"><a href="HTTP://banana.bmc.com/cgi-bin/calweb/calweb.exe" class="bodyText"><font style="font-size: 8pt" face="Tahoma">Calendar Application</font></a></td>
</tr>



<tr>
<td width="10%"></td>
<td width="100%" valign="top"><a href="HTTP://fishtail.bmc.com/csg/staging/brandpack/" class="bodyText"><font style="font-size: 8pt" face="Tahoma">Employee Brand Pack</font></a></td>
</tr>


</table>
</span>
</td>
</tr>


</table>
</td>
</tr>

</table>
</td>
</tr>

</table>
</td>
</tr>
</table>
</td>
<td width=15><img src="/virtuals/vap/CWW/images/spacer.gif" height=1 width=15></td>
</tr>
</table>
</body>
</html>[/HTML]
Nov 7 '08 #1
1 5880
pronerd
392 Expert 256MB
And so your question is? Is there a problem? If so what? Is there an error if so what does it say?
Nov 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I am using a few Input type of "Image" instead of a classic submit button in a form to achieve various tasks for example image1 - add user image2 - modify user image3 - delete user...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
3
by: Jürgen Heyn | last post by:
Good morning, on form 2 input elements and 1 image are placed. The 1st (Index) one is "hidden", the 2nd ) is an empty textbox. When clicking the picture I would like to toogle a boolean value....
2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
2
by: Brian | last post by:
Im trying to toggle a series of images with an onLoad event. I have my code checking the value of a hidden textbox. Depending on the value pf the text box, it will display one image for one and...
2
by: Madame Blablavatsky | last post by:
hello, i have an image that is also a link: <a href="javascript:opmaak('bold','')"><img src='bold_uit.gif name='uit'></a> when the image/link is clicked it triggers a javascript that...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
3
by: lofty00 | last post by:
hello, sorry about the repost - I've been posting to several groups and I've decided it's better to make a single repost to all of them rather than an extra post in each. I've been trying to...
4
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.