Seymour Clufley
02-12-2008, 07:21 PM
Here is the code I'm using:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<TITLE>test</TITLE>
<SCRIPT><!--
function HoverCursor(oImg){ oImg.style.cursor='url(test2.ani)'; }
function NormalCursor(oImg){ oImg.style.cursor='url(MainBodyCursor.cur)'; }
--></SCRIPT>
<STYLE>
BODY{cursor:url("MainBodyCursor.cur");}
</STYLE>
<STYLE type=text/css>
.main { font-family: Courier New; font-size: 12px; color: #FFFFFF; background: #101010 }
.cursorchange { border:0px; border-color:#FFFFFF ; }
a.cursorchange:hover { cursor:url(HoverCursor.cur); }
</STYLE>
</HEAD><BODY class=main><TABLE width=99% align=center>
<img src="bitmap.bmp" name="attackme" onmouseover="HoverCursor(this)" onmouseout="NormalCursor(this)" >
<BR>This image uses an onMouseOver event to trigger a JavaScript function to change the cursor. And then an onMouseOut event triggers another JS function to change the cursor back to normal.
<P><P><P>
<a href="#" class="cursorchange"><img src="bitmap.bmp"></a>
<BR>This image uses CSS - the "CursorChange" class. It works fine changing the cursor, but the image has an annoying blue outline!
<P><P>
</TABLE></BODY></HTML>
The problems are detailed in the page. I'm using two different methods to try to get the effect I want. It's simply for the cursor to change to a custom cursor whilst it is over an image, and then change back when it leaves the image.
The first method uses onMouseOver to trigger a JavaScript function. The problem here is that, bizarrely, the cursor change only works twice. Or once, if I include an onMouseOut event.
The second method uses CSS. The problem here is that, though the cursor stuff works fine, the image has a border around it which I would like to get rid of.
The page uses a BASE tag at the start but removing that seems to make no difference. Why would the JavaScript function only work once? It's strange. And why can't I get rid of the border created by the CSS method?
Can anyone please help? I'd be very grateful.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<TITLE>test</TITLE>
<SCRIPT><!--
function HoverCursor(oImg){ oImg.style.cursor='url(test2.ani)'; }
function NormalCursor(oImg){ oImg.style.cursor='url(MainBodyCursor.cur)'; }
--></SCRIPT>
<STYLE>
BODY{cursor:url("MainBodyCursor.cur");}
</STYLE>
<STYLE type=text/css>
.main { font-family: Courier New; font-size: 12px; color: #FFFFFF; background: #101010 }
.cursorchange { border:0px; border-color:#FFFFFF ; }
a.cursorchange:hover { cursor:url(HoverCursor.cur); }
</STYLE>
</HEAD><BODY class=main><TABLE width=99% align=center>
<img src="bitmap.bmp" name="attackme" onmouseover="HoverCursor(this)" onmouseout="NormalCursor(this)" >
<BR>This image uses an onMouseOver event to trigger a JavaScript function to change the cursor. And then an onMouseOut event triggers another JS function to change the cursor back to normal.
<P><P><P>
<a href="#" class="cursorchange"><img src="bitmap.bmp"></a>
<BR>This image uses CSS - the "CursorChange" class. It works fine changing the cursor, but the image has an annoying blue outline!
<P><P>
</TABLE></BODY></HTML>
The problems are detailed in the page. I'm using two different methods to try to get the effect I want. It's simply for the cursor to change to a custom cursor whilst it is over an image, and then change back when it leaves the image.
The first method uses onMouseOver to trigger a JavaScript function. The problem here is that, bizarrely, the cursor change only works twice. Or once, if I include an onMouseOut event.
The second method uses CSS. The problem here is that, though the cursor stuff works fine, the image has a border around it which I would like to get rid of.
The page uses a BASE tag at the start but removing that seems to make no difference. Why would the JavaScript function only work once? It's strange. And why can't I get rid of the border created by the CSS method?
Can anyone please help? I'd be very grateful.