Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange cursor flashes when user clicks on a JS button 1

Status
Not open for further replies.

ShikkurDude

Programmer
Mar 15, 2005
55
US
I have the following two bits of code:
Code:
<INPUT style="BACKGROUND-POSITION-X: center; BACKGROUND-IMAGE: url([URL unfurl="true"]http://web.amg.advo-health.com/commonimages/cmdcancel.gif);[/URL] WIDTH: 64px; CURSOR: hand; BORDER-TOP-STYLE: none; BACKGROUND-REPEAT: no-repeat; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 24px; BORDER-BOTTOM-STYLE: none" onclick="ShowCancelMenu()">
and
Code:
function ShowCancelMenu()
	{
		var CancelMenu
		CancelMenu = document.getElementById('CancelMenu')
		CancelMenu.style.visibility = '' 
	}
Here's the problem... When the user clicks on that cancel button - even if it's not a complete click - rather the user just presses the mouse button down on the cancel button - but releases the mouse button when not on the cancel button, a funny thing happens: a blinking caret/cursor begins flashing to the immediate left of the cancel button, and continues doing so until the user clicks somewhere else on the page.

I don't want that flashing cursor at all; how can I get rid of it?

Thanks so much,
E.
 
What button? I see no button in your code. Given that you have declared an input element with no "type" attribute, I imagine the default type would be of "text". Try explicitly setting the type to be "button":

Code:
<input type="button"...>

Incidentally, if this is going to be run on anything other that IE, you should change this:

Code:
CURSOR: hand;

to this:

Code:
CURSOR: pointer;

as the former is IE-only, while the latter is standards compliant and thus works in most browsers.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Dan, you hit my non-button on the head! Perfect *** !!!

Aarem, thanks, too!

E.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top