RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 939 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 1
Reputation: shaist is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shaist shaist is offline Offline
Newbie Poster

Help Help with JavaScript Menu

  #1  
Jul 28th, 2007
Hi. Im developing my first website and need some help with my menu. Im trying to use the rollover effect using images. The 'MouseOver' function is working just fine. But I need the second image(hover image) to appear and stay there when the user clicks on the link and opens the new page and returns to the first image when another button is clicked. Is there a way to do that without designing a new menu for every page?

I tried using the 'OnMouseClick' event but its not working. Maybe I am doing something wrong?

Hope someone can help. My code is below :

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>menu</title>
<link rel="stylesheet" type="text/css" href="CSS/text.css">
<script type="text/javascript">



if (document.images) 
{

lettersN = new Image(143,23);
lettersN.src = 'images/buttonLetters.gif';

lettersH = new Image(143,23);
lettersH.src = 'images/a_buttonLetters.gif';



function myOn(myImgName) 
{ 
document[myImgName].src=eval(myImgName+ 'H' ).src; 
} 

function myOut(myImgName) 
{ 
document[myImgName].src=eval(myImgName+ 'N' ).src; 
} 
function changeImg(myImgName) 
{
document[myImgName].src = eval(myImgName+ 'H' ).src;
}


}

</script>


</head>

<body>



<table >
	<tr>
		<td colspan="3" height="29">



<a HREF= "tajweed_letters.htm" ><img 


SRC= "images/buttonLetters.gif" ALT= "Java Script Contents" NAME= "letters" BORDER= "0" 
onMouseOver = "myOn(this.name)" 

onMouseOut = "myOut(this.name)"

onMouseClick = "myOn(this.name)"


onMouseClick="changeImg(this.name); return false;">



</a>
</tr>
</td>
	


	
</table>


</body>

</html>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,666
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 990
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Help with JavaScript Menu

  #2  
Jul 28th, 2007
moved
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,054
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 372
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Help with JavaScript Menu

  #3  
Jul 28th, 2007
There is no 'onmouseclick' attribute, its 'onclick' you are looking for...
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:32 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC