PDA

View Full Version : Looking for the javascript(onclick function)



Sudha
08-19-2007, 02:59 PM
Hi everyone,

As i'm new to this forum and i'm looking for the script.let me explain :

1) I have 4 icon links - I've integrated onmouseover event to all 4 icons..when i click one of the icon, it should be an hightlighted icon(hightlighted image icon-i have the image) and the other goes to normal..

tr>
<td valign="top" width="0"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/ic_1_on.jpg',1)"><img name="Image5" border="0" src="images/ic_1.jpg" width="77" height="92"></a></td>

<td align="right" valign="top" width="0"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','images/ic_2_on.jpg',1)"><img name="Image7" border="0" src="images/ic_2.jpg" width="77" height="92"></a></td>

<td align="right" valign="top" width="0"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','images/ic_3_on.jpg',1)"><img name="Image8" border="0" src="images/ic_3.jpg" width="75" height="92"></a></td>

<td align="right" valign="top" width="0"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','images/ic_4_on.jpg',1)"><img name="Image20" border="0" src="images/ic_4.jpg" width="74" height="92"></a></td>

</tr>

2 In the same above, i also wants to change the color of the left links(text) :I've used CSS for this when mouseover changed the color of the links..In the same way, i used to change the color of the text when onclick the particular link, the others remain normal..

CSS file

a.leftlink
{
FONT-SIZE: 11px;
FONT-WEIGHT: normal;
COLOR:black;
FONT-FAMILY: Tahoma;
text-decoration:none;
}

a.leftlink:hover
{
FONT-SIZE: 11px;
FONT-WEIGHT: normal;
COLOR:red;
FONT-FAMILY: Tahoma;
text-decoration:none;
}


<a href="#" class="leftlink">Processes</a>
<a href="#" class="leftlink">System Info</a>
<a href="#" class="leftlink">Reports</a>
<a href="#" class="leftlink">Login</a>


It would be more helpful to me if i got the solution for this asap..
Thanx

saxenaabhi
08-19-2007, 03:44 PM
set the hyperlink properties in the body segment of ur css
may it work

Sudha
08-19-2007, 06:35 PM
when i click one of the icon, it should be an hightlighted icon(hightlighted image icon-i have the image) and the other goes to normal

I think this can be done by set the id value for all the links..
so that we can highlight the specific one when clicked.

Hope u get my query...I dont know how to do this..can u help me?