473,699 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom cursor using Javascript in Firefox

KeredDrahcir
426 Contributor
I'm trying to use an onmouseover event to change the cursor to a custom .cur image.
onMouseOver="th is.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?
Nov 24 '09
19 7252
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
Dec 5 '09 #11
KeredDrahcir
426 Contributor
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.
Dec 7 '09 #12
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.
Expand|Select|Wrap|Line Numbers
  1. onmouseover="this.style.cursor=\"url(icons/cursor.cur),auto\";"
You could also consider using CSS only with "hover".
Dec 7 '09 #13
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 :)
Dec 7 '09 #14
DMsy2
15 New Member
Is .cur a proprietary M$ format that only IE supports?
Dec 8 '09 #15
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:
Expand|Select|Wrap|Line Numbers
  1. cursor:  url(foo.cur), url(http://www.example.com/bar.gif), auto;
Dec 13 '09 #16
KeredDrahcir
426 Contributor
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,
Dec 14 '09 #17
KeredDrahcir
426 Contributor
I now have it working in IE, Firefox, Safari and Google Chrome. Any ideas how to get it working in Opera?
Dec 15 '09 #18
acoder
16,027 Recognized Expert Moderator MVP
I don't think Opera supports custom cursors.
Dec 21 '09 #19
I also have a similar problem but it's work for me when i entered the full path to the cursor file.
Nov 20 '10 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6904
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: This works for the body, font or img tag: <body style="cursor: url('cursor2.cur')"> <font style="cursor: url('cursor1.cur')">Text</font> <img style="cursor: url('cursor1.cur')" src="...etc...">
4
2527
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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
1
4576
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. Other than href, is there a way to make the cursor change upon rollover? Only when a particular area has been clicked on do I wish for others to react to a rollover. This is all done in JS within the same page, and it works - except for the mouse...
1
4595
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 region). The image map is created in javascript, but doesn't set any 'cursor' style rules. The problem I'm having is I have two images embedded inside two divs. The outer div has style='... cursor:crosshair', but when I move over the image...
3
6450
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 clicked, custom attributes are parsed from the link and submitted to the application as hidden form fields. The code below better illustrates the HTML: <a class="postback" c:myAttribute1="value" c:myAttribute2="value">submit</a>
1
2130
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 javascript depending the requirement can we change or assign the image cursor ? help me if any one knows the solution for this . bye Ravishankar Maduri
1
8660
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"> <!-- function onMouseOver() { document.body.style.cursor="hand"; } function onMouseOut() { document.body.style.cursor="default";
3
4603
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) that will automatically move to the END of the existing text (a blinking cursor). Yes, I've Googled, but cannot seem to locate just what I'm looking for.
26
2527
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 one's own somehow?? Just a noob at this...TIA!!
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8908
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
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 we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.