Page 1 of 1

onmouseover

Posted: Wed Aug 27, 2003 9:51 am
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>")
?>

Posted: Wed Aug 27, 2003 10:01 am
by volka
that's your code, but what's the problem?

Posted: Wed Aug 27, 2003 10:08 am
by mallu
When I bring the mouse over the image nothing happens...

Biju

Posted: Wed Aug 27, 2003 10:09 am
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

Posted: Wed Aug 27, 2003 10:27 am
by mallu
Thanks volka... it works now...

mallu

Posted: Wed Aug 27, 2003 10:27 am
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 ;)

Posted: Wed Aug 27, 2003 10:35 am
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... ;) )