473,569 Members | 2,463 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 #1
19 7245
gits
5,390 Recognized Expert Moderator Expert
you might use:
Expand|Select|Wrap|Line Numbers
  1. this.style.cursor = 'pointer';
kind regards
Nov 24 '09 #2
drhowarddrfine
7,435 Recognized Expert Expert
Because IE does it wrong like everything else. It should be:
this.style.curs or = "url(icons/cursor.cur)";

And onmouseover should be lower case in xhtml, at least.
Nov 25 '09 #3
KeredDrahcir
426 Contributor
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?
Nov 25 '09 #4
gits
5,390 Recognized Expert Moderator Expert
of course ... either use single quotes inside the doubles or escape the inside double quotes:
Expand|Select|Wrap|Line Numbers
  1. onmouseover="this.style.cursor=\"url(icons/cursor.cur)\";"
  2.  
regards
Nov 25 '09 #5
KeredDrahcir
426 Contributor
I've tried that and it still doesn't work.
Dec 1 '09 #6
gits
5,390 Recognized Expert Moderator Expert
does it work with any other 'webaware' image like a gif or jpeg?

kind regards
Dec 3 '09 #7
KeredDrahcir
426 Contributor
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.
Dec 3 '09 #8
gits
5,390 Recognized Expert Moderator Expert
never tried it ... but the following:
Expand|Select|Wrap|Line Numbers
  1. onmouseover="this.style.cursor='pointer';"
works
Dec 3 '09 #9
KeredDrahcir
426 Contributor
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.
Dec 4 '09 #10

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

Similar topics

3
6893
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...
4
2521
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
4565
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...
1
4591
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...
3
6446
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...
1
2122
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...
1
8655
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
4588
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...
26
2511
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
7703
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
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. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
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...
0
7982
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...
0
6286
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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...
0
3656
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...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.