onmouseover

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mallu
Forum Newbie
Posts: 9
Joined: Thu Aug 21, 2003 10:32 am

onmouseover

Post by mallu »

Hi there:

I have been trying to use onmouseover since yesterday and its driving me nuts. Any help on this will be much appreciated...

Thanks

Biju

Code: Select all

<SCRIPT language="JavaScript">
function movepic(img_name,img_src) &#123;
   
  document&#1111;img_name].src=img_src;
  
&#125;
</SCRIPT>

<?

print ("<table border=0 cellspacing=0 cellpadding=0 align='right'> <tr><td><img src='legend_a.png'  border='0' align='right' onMouseOver=movepic('picture','legend_b.png') 
              onmouseout=movepic('picture','legend_a.png')><IMG NAME='picture' SRC='legend_a.png'></td></tr>");
print ("</table>")
?>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

that's your code, but what's the problem?
mallu
Forum Newbie
Posts: 9
Joined: Thu Aug 21, 2003 10:32 am

Post by mallu »

When I bring the mouse over the image nothing happens...

Biju
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

try this

Code: Select all

<? 

print ("<table border=0 cellspacing=0 cellpadding=0 align='right'> <tr><td><img src='legend_a.png'  border='0' align='right' onMouseOver=movepic('picture','legend_b.png') onmouseout=movepic('picture','legend_a.png') IMG NAME='picture'></td></tr>"); 
print ("</table>") 
?>
Also, this isn't really a PHP problem, and i am not even sure why you are using PHP!?

Mark
mallu
Forum Newbie
Posts: 9
Joined: Thu Aug 21, 2003 10:32 am

Post by mallu »

Thanks volka... it works now...

mallu
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

since there's no need for php for this code snippet I made it a static html

Code: Select all

<html>
	<head>
		<SCRIPT language="JavaScript">
			function movepic(img_name,img_src) &#123;
				document&#1111;img_name].src=img_src;
			&#125;
		</SCRIPT>
	</head>
	<body>
		<table border=0 cellspacing=0 cellpadding=0 align='right'>
			<tr>
				<td>
					<img src='legend_a.png'  border='0' align='right'
						onMouseOver=movepic('picture','legend_b.png') onmouseout=movepic('picture','legend_a.png') />
					<IMG NAME='picture' SRC='legend_a.png'>
				</td>
			</tr>
		</table>
	</body>
</html>
although I'd quote the onmouse[over|out] property it is working for me

oops, too late ;)
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Shouldn't " be used instead of ' when it comes to 'plain' html?

(No not, nagging just because you disliked my not-closing-tags earlier, but it looks odd and funny... ;) )
Post Reply