I'm trying to use an onmouseover event to change the cursor to a custom .cur image.
onMouseOver="this.style.cursor='icons/cursor.cur';"
The above code works fine in IE but not in Firefox. It's important the users know where they can click.
Could anyone help please?
19 7236 gits 5,390
Recognized Expert Moderator Expert
you might use: - this.style.cursor = 'pointer';
kind regards
Because IE does it wrong like everything else. It should be:
this.style.cursor = "url(icons/cursor.cur)";
And onmouseover should be lower case in xhtml, at least.
Thanks for the reply drhowarddrfine but I did try that code before I came here. I've tried it again and it still doesn't seem to work. I see you've put double quotes around the path to find the cursor. Since onmouseover goes in quotes could that cause a problem?
gits 5,390
Recognized Expert Moderator Expert
of course ... either use single quotes inside the doubles or escape the inside double quotes: - onmouseover="this.style.cursor=\"url(icons/cursor.cur)\";"
-
regards
I've tried that and it still doesn't work.
gits 5,390
Recognized Expert Moderator Expert
does it work with any other 'webaware' image like a gif or jpeg?
kind regards
I'll try that. Can it be done in Firefox? JavaScript Kit say it's IE only although the page was talking about NS so it was proabaly quite old.
gits 5,390
Recognized Expert Moderator Expert
never tried it ... but the following: - onmouseover="this.style.cursor='pointer';"
works
I can get the cursor as a pointer but the image still doesn't work. I've tried it as a gif and all I get (as before) is the text cursor.
I've got the pointer working elshwere on the same page.
gits 5,390
Recognized Expert Moderator Expert
so using the pointer should be sufficient ... since it shows the standard 'here you can click' cursor? ... i'm not quite sure whether I would use another cursor or image except I would need it for a browser based game ... or why is it essential to have another custom cursor?
kind regards
I can use the pointer but using the custom cursor just helps remind us whether we are logged in as user or administrator.
It don't suppose it's essential but it does improve the look. I just thought it should be possible.
acoder 16,027
Recognized Expert Moderator MVP
I may be wrong, but I think you need to specify a default, e.g. "auto" or "default" for the custom cursor to work, e.g. - onmouseover="this.style.cursor=\"url(icons/cursor.cur),auto\";"
You could also consider using CSS only with "hover".
gits 5,390
Recognized Expert Moderator Expert
in case it would be essential then have a look here and see if it helps ... but for your specific purpose personally i just would apply another style to the app's background-color or something more visible as a cursor ...
kind regards
PS: ahh ... try acoder's hint first ... may be it helps? ... as i said before ... i never used custom cursors before :)
Is .cur a proprietary M$ format that only IE supports?
rnd me 427
Recognized Expert Contributor @DMsy2
yes and no.
.cur is basically a monochrome bitmap, so it may be viewable when loaded as a bmp, which many browsers handle.
Firefox allows .cur since 2.0 according to MDC, this is your best bet:
Thanks for all your help, acoder's solution of adding the defualt afterwards works. Adding the url(***.cur) stopped working in IE but when I added the default it worked again in IE and now works in Firefox.
Many thanks all,
I now have it working in IE, Firefox, Safari and Google Chrome. Any ideas how to get it working in Opera?
acoder 16,027
Recognized Expert Moderator MVP
I don't think Opera supports custom cursors.
I also have a similar problem but it's work for me when i entered the full path to the cursor file.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Simon Wigzell |
last post by:
I have an image with several links in it in mapped areas. I am using a
custom cursor on the page and would like to have a custom cursor appear on
mouse over of the mapped links. Something like:
...
|
by: VK |
last post by:
I have this code failing to work in IE: getElementsByTagName doesn't
return elements from my JS namespace. What's wrong?
<html xmlns:js>
<head>
<title>Que</title>
<meta...
|
by: piccolo |
last post by:
This is the first time I've posted a 'help' request, so please be patient.
I've created a DOM web page where with the usage of usemap images on the page change upon rollover using JavaScript....
|
by: Andy Baxter |
last post by:
hello,
I'm writing a panoramic image viewer in javascript. When the mouse is over
the image, I want it to be a crosshair (over most of the image), or a
hand/pointer (when it's over an image map...
|
by: mrsd2c |
last post by:
I am building custom attributes as a means to pass data from the client
to the server. To accomplish this task, a class of "postback" is
applied to a link or button. When the link or button is...
| |
by: mshankar |
last post by:
hi, friends any one know the solution for how to set the image to a cursor in firefox using javascript
i know to set this
by using stylesheet
cursor :url("ravishankar.cur"),pointer
but using...
|
by: ryezack |
last post by:
i have an image map with an onmouseover event thats calls a javascript function style cursor is hand. this works in IE but not in firefox. here's the code:
<script type="text/javascript">
<!--...
|
by: Klaus Brune |
last post by:
Hello all,
When one tabs through a form (specifically, in Firefox), all the text in
a field is automatically selected.
What I'm looking for is a way to put a function (in onFocus perhaps)...
|
by: Prisoner at War |
last post by:
Hello, Everyone:
Is there any other values or whatever-it's-called to the cursor
property in CSS??
So far, I only know of cursor:pointer (or, for MSIE, cursor:hand)....
Any way to load in...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |