Shoutbox

Changing Mouse Icon On A Site ( whats the code )? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Changing Mouse Icon On A Site ( whats the code )? (/showthread.php?tid=43984)

Changing Mouse Icon On A Site ( whats the code )? by albert on 05-01-2005 at 11:48 PM

Anyone knows the code to change the mouse icon on a website, I know it's possible i just can't find it anymore.


RE: Changing Mouse Icon On A Site ( whats the code )? by 3DCS on 05-02-2005 at 12:49 AM

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


RE: Changing Mouse Icon On A Site ( whats the code )? by M73A on 05-02-2005 at 12:51 AM

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
RE: Changing Mouse Icon On A Site ( whats the code )? by 3DCS on 05-02-2005 at 12:55 AM

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.


RE: Changing Mouse Icon On A Site ( whats the code )? by albert on 05-02-2005 at 12:55 AM

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.. :(
RE: Changing Mouse Icon On A Site ( whats the code )? by M73A on 05-02-2005 at 12:59 AM

THANKS! ive been trying to find this out for ages:P


RE: RE: Changing Mouse Icon On A Site ( whats the code )? by 3DCS on 05-02-2005 at 02:06 AM

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>
RE: Changing Mouse Icon On A Site ( whats the code )? by absorbation on 05-02-2005 at 11:49 AM

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>


RE: Changing Mouse Icon On A Site ( whats the code )? by albert on 05-02-2005 at 07:41 PM

thx a lot everyone!