PDA

View Full Version : Custom Cursor...



*Jess*
January 10th '06, 08:31 PM
I have made a custom cursor in flash but I don't know the code/can't be bothered working out the code to put it on a website. aha.
does anybody know?

Mattimadhead
January 10th '06, 08:33 PM
No but i was looking into the same thing myself..

Shane
January 10th '06, 08:58 PM
What did you use to make it in flash? Need more details. :P

Mattimadhead
March 19th '06, 11:41 AM
ermm.. ive sin one of a website and instead of the usualy one fingue pointer theres was the bull horns instead

Bob!
March 19th '06, 04:35 PM
Erm I suggest goin on one of those piczo sites or whatever they are, them ones normally have custom cursors, the site will probably let you select one and do it for ya when you make it as I doubt all those people have manually coded them.

Anyways try finding one of those sites with a custom cursor on it, then right click and look at the source code, see if ya can find the code for the custom cursor, then just modify it for your own?

LukeEv_17
March 20th '06, 08:33 PM
i think freewebs allows you to have custom cursors

Feign
June 1st '06, 05:09 PM
Custom cursors don't really constitute as valid code, and thus aren't supported by browsers outside of IE. In addition to that, most people find them downright annoying. Sure, its a novelty thing, but it soon tires. If possible, intergrate it into a seperate stylesheet and enable users the option of turning it off if they should so please.

Shane
June 1st '06, 09:31 PM
You can get it to work outside of IE, but unfortunately you need to piss about and define the path to the Cursor file. :/

Feign
June 1st '06, 09:35 PM
Relative or absolute?

Feign
June 1st '06, 09:40 PM
Ew. Nevermind.


<script language="JavaScript" type="text/javascript">
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.c lientY+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>
Where:

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)

defines the images used - formatted as such:"image.ext",width,height

Edit accordingly.

There appears to be a CSS solution as well, if stylesheets are your thing.


n {
cursor: wait / crosshair / hand / help / text / move }

^ Delete as appropriate (ie: n { cursor: wait; } )

I'll look into a custom one, but if you're not using the Javascript solution, tis only effective in IE.

Personally, I'd drop the concept altogether. Tis almost as annoying as frames and heaps upon heaps of animated gifs.

Guest
August 3rd '06, 07:04 AM
I used to design libraries of cursors. The best way I found was designing an icon in Axialis Icon Workshop (free-trial shareware: fully functional for 30 days; download at http://www.axialis.com/download/iw.html) and importing it to a cursor editor. The IconWorkshop allows adjustment of Alpha (Opacity) from 0-255. This way, your cursors can be translucent.

If you want to use the program one time now and another in two months (when the free-trial would be otherwise expired), uninstall it after use and re-install it before using it next time. It only takes a few.