What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Changing Mouse Icon On A Site ( whats the code )?

Changing Mouse Icon On A Site ( whats the code )?
Author: Message:
albert
Veteran Member
*****

Avatar

Posts: 2247
Reputation: 42
– / Male / Flag
Joined: Feb 2005
O.P. Changing Mouse Icon On A Site ( whats the code )?
Anyone knows the code to change the mouse icon on a website, I know it's possible i just can't find it anymore.
05-01-2005 11:48 PM
Profile E-Mail PM Web Find Quote Report
3DCS
Junior Member
**

Avatar
Birds have fingers?

Posts: 22
– / Male / –
Joined: Jan 2003
RE: Changing Mouse Icon On A Site ( whats the code )?
Use the CSS cursor attribute
more info here:
http://www.w3schools.com/css/pr_class_cursor.asp

the only problem with cursor 'url' images is that it is ie spacific, other browsers more than likely wont support it

~ 3

This post was edited on 05-02-2005 at 12:50 AM by 3DCS.
05-02-2005 12:49 AM
Profile E-Mail PM Find Quote Report
M73A
Veteran Member
*****

Avatar


Posts: 3213
Reputation: 37
34 / Male / Flag
Joined: Jul 2004
RE: Changing Mouse Icon On A Site ( whats the code )?
quote:
Originally posted by 3DCS
Use the CSS cursor attribute
more info here:
http://www.w3schools.com/css/pr_class_cursor.asp


~ 3

thats useful..... but u can have a completely diferent set of cursors than windows cant you *-) i swear ive seen it on sites before

[Image: lost7ru.gif]
05-02-2005 12:51 AM
Profile E-Mail PM Find Quote Report
3DCS
Junior Member
**

Avatar
Birds have fingers?

Posts: 22
– / Male / –
Joined: Jan 2003
RE: Changing Mouse Icon On A Site ( whats the code )?
Yea,
As i mentioned in my edit is that theres a url() option that'll link to a .cur cursor file the same way that background-image:url() works.
the only problem is that I believe it'll only work in Internet Explorer.
05-02-2005 12:55 AM
Profile E-Mail PM Find Quote Report
albert
Veteran Member
*****

Avatar

Posts: 2247
Reputation: 42
– / Male / Flag
Joined: Feb 2005
O.P. RE: Changing Mouse Icon On A Site ( whats the code )?
quote:
Originally posted by may73alliance
quote:
Originally posted by 3DCS
Use the CSS cursor attribute
more info here:
http://www.w3schools.com/css/pr_class_cursor.asp


~ 3

thats useful..... but u can have a completely diferent set of cursors than windows cant you *-) i swear ive seen it on sites before

exactly what i want.. just wanna make it purple.. :(
05-02-2005 12:55 AM
Profile E-Mail PM Web Find Quote Report
M73A
Veteran Member
*****

Avatar


Posts: 3213
Reputation: 37
34 / Male / Flag
Joined: Jul 2004
RE: Changing Mouse Icon On A Site ( whats the code )?
THANKS! ive been trying to find this out for ages:P

[Image: lost7ru.gif]
05-02-2005 12:59 AM
Profile E-Mail PM Find Quote Report
3DCS
Junior Member
**

Avatar
Birds have fingers?

Posts: 22
– / Male / –
Joined: Jan 2003
RE: RE: Changing Mouse Icon On A Site ( whats the code )?
quote:
Originally posted by lp15
quote:
Originally posted by may73alliance
quote:
Originally posted by 3DCS
Use the CSS cursor attribute
more info here:
http://www.w3schools.com/css/pr_class_cursor.asp


~ 3

thats useful..... but u can have a completely diferent set of cursors than windows cant you *-) i swear ive seen it on sites before

exactly what i want.. just wanna make it purple.. :(



In case ya still need help..
To make a custom cursor (such as purple) you'll need to make your own image for the cursor and save it as a .cur (cursor) file.

There are some good programs that'll be able to do this, but I can't really recommend one because I never used it myself.
I suggest you just google for a tool to create .cur files unless you already know how to do that.

To use a custom .cur image in your HTML code
<STYLE type="text/css">
<!--
body { cursor:url("CURSOR.cur"); }
-->
</STYLE>
05-02-2005 02:06 AM
Profile E-Mail PM Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: Changing Mouse Icon On A Site ( whats the code )?
If you see a cursor design you like, right click on the image and choose "save as" to save the image to your hard drive. You'll need to download all six images in order to make one cursor. You can copy and paste the following code and add it to your page after the <body> tag. You do need to substitute each of your 6 image names in this code where it says "imagename.gif." Each of the images that I have provided are numbered from 1-6 (not necessarily smallest to largest in size) and they have to stay numbered that way in the code. If you alter this code in any way, other than the image name, it will not work.


<script language="JavaScript" type="text/javascript">

/******************************************
* Cross browser cursor trailer script- By Brian Caputo (bcaputo@icdc.com)
* Distributed with permission from Brian Caputo by lissaexplains.com
* Modified Dec 31st, 02' by DD. This notice must stay intact for use
******************************************/

A=document.getElementById
B=document.all;
C=document.layers;
T1=new Array("image6.gif",45,45,"image5.gif",45,45,"image4.gif",45,45,"image3.gif",45,45,"image2.gif",45,45,"image1.gif",45,45)

var offsetx=0 //x offset of trail from mouse pointer
var offsety=0 //y offset of trail from mouse pointer

nos=parseInt(T1.length/3)
rate=50
ie5fix1=0;
ie5fix2=0;
rightedge=B? document.body.clientWidth-T1[1] : window.innerWidth-T1[1]-20
bottomedge=B? document.body.scrollTop+document.body.clientHeight-T1[2] : window.pageYOffset+window.innerHeight-T1[2]

for (i=0;i<nos;i++){
createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")
}

function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){
with (document){
write((!A && !B) ? "<layer id='"+N+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+"; ");
if(St){
if (C)
write(" style='");
write(St+";' ")
}
else write((A || B)?"'":"");
write((At)? At+">" : ">");
write((HT) ? HT : "");
if (!Op)
closeContainer(N)
}
}

function closeContainer(){
document.write((A || B)?"</div>":"</layer>")
}

function getXpos(N){
if (A)
return parseInt(document.getElementById(N).style.left)
else if (B)
return parseInt(B[N].style.left)
else
return C[N].left
}

function getYpos(N){
if (A)
return parseInt(document.getElementById(N).style.top)
else if (B)
return parseInt(B[N].style.top)
else
return C[N].top
}

function moveContainer(N,DX,DY){
c=(A)? document.getElementById(N).style : (B)? B[N].style : (C)? C[N] : "";
if (!B){
rightedge=window.innerWidth-T1[1]-20
bottomedge=window.pageYOffset+window.innerHeight-T1[2]
}
c.left=Math.min(rightedge, DX+offsetx);
c.top=Math.min(bottomedge, DY+offsety);
}
function cycle(){
//if (IE5)
if (document.all&&window.print){
ie5fix1=document.body.scrollLeft;
ie5fix2=document.body.scrollTop;
}
for (i=0;i<(nos-1);i++){
moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1)))
}
}

function newPos(e){
moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2)
}

function getedgesIE(){
rightedge=document.body.clientWidth-T1[1]
bottomedge=document.body.scrollHeight-T1[2]
}

if (B){
window.onload=getedgesIE
window.onresize=getedgesIE
}

if(document.layers)
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=newPos
setInterval("cycle()",rate)
</script>
05-02-2005 11:49 AM
Profile PM Find Quote Report
albert
Veteran Member
*****

Avatar

Posts: 2247
Reputation: 42
– / Male / Flag
Joined: Feb 2005
O.P. RE: Changing Mouse Icon On A Site ( whats the code )?
thx a lot everyone!
05-02-2005 07:41 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On