Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > BOOK: Beginning HTML, XHTML, CSS, and JavaScript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 6th, 2010, 09:05 PM
Registered User
 
Join Date: Apr 2010
Location: Planet Earth
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default Help with changing cursor to an image

Hello everyone!
In this book, it says how you can change the appearance of the cursor to different cursors, such as the hourglass, hand...
You can also change it to an image, but there is no sample code that tells me how to do this.
Can someone please give me a sample CSS code for this?
Let's suppose the image was called "image.png" and in the file "images," therefore the url will look like this - images/image.png

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old April 7th, 2010, 10:38 AM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

The following works in IE8, Safari and Chrome. Unfortunately not Firefox and Opera.

Code:
<html>
<head>

</head>
<body>
	<h1 onclick="document.body.style.cursor = 'url(3dsmove.cur), default';">Foo</h1>
</body>
</html>
Reply With Quote
  #3 (permalink)  
Old April 7th, 2010, 10:41 AM
Registered User
 
Join Date: Apr 2010
Location: Planet Earth
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
The following works in IE8, Safari and Chrome. Unfortunately not Firefox and Opera.

Code:
<html>
<head>

</head>
<body>
	<h1 onclick="document.body.style.cursor = 'url(3dsmove.cur), default';">Foo</h1>
</body>
</html>
Thanks!
I assume that this only takes .cur file extensions. Am I correct, or can it take .png or .jpeg or .gif also?
Second, can I save images as a .cur file in Paint? I tried it in a program called GIMP, and it didn't allow me to do that.
Third, in that code, it only sets the cursor for that specific <H1> element. Can I make it for the entire body?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move image when cursor approaches sanjana Pro Visual Basic 2005 1 July 19th, 2007 04:55 PM
Word-cursor position using mouse is not changing jahid Pro VB 6 2 February 6th, 2007 05:32 AM
Unable to set image or cursor property, Ch 12. VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 5 April 26th, 2006 10:49 AM
Document Image Processing (DIP) - changing image f ALcom Access 0 March 27th, 2006 06:10 AM



All times are GMT -4. The time now is 04:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.