Buscar hosting en BuscaHost.com Alojamiento web : Plataforma Windows Plataforma Linux/Unix Espacio: Costo:
Servicio proporcionado por BuscaHost.com, el primer buscador de hosting hispano


Efectos de JavaScript para el puntero

Estos codigos JavaScript resultan en varios efectos para el puntero de tu pagina.

Imagen que sigue al cursor

<script type="text/javascript"> /*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/ var trailimage=["URL DE LA IMAGEN", 100, 99] //image path, plus width and height
var offsetfrommouse=[10,-20] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0 //Duracion De La Imagen. 0 sgnifica siempre. if (document.getElementById || document.all)
document.write('<div id="trailimageid" style="position:absolute;
visibility:visible;
left:0px;
top:0px;
width:1px;
height:1px">
<img src="'+trailimage[0]+'" border="0" width="'+trailimage[1]+'px" height="'+trailimage[2]+'px"></div>') function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
} function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
} function hidetrail(){
gettrailobj().visibility="hidden"
document.onmousemove="" } function followmouse(e){
var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
if (typeof e != "undefined"){
xcoord+=e.pageX
ycoord+=e.pageY
}
else if (typeof window.event !="undefined"){
xcoord+=truebody().scrollLeft+event.clientX
ycoord+=truebody().scrollTop+event.clientY
}
var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
if (xcoord+trailimage[1]+3>docwidth || ycoord+trailimage[2]> docheight)
gettrailobj().display="none"
else
gettrailobj().display=""
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"
} document.onmousemove=followmouse if (displayduration>0)
setTimeout("hidetrail()", displayduration*1000) </script>

Estrellas Que Siguen Al Cursor
Esto entre las etiquetas <head></head>

<STYLE TYPE="text/css">
<!-- BODY{
overflow:scroll;
overflow-x:hidden;
} .s1
{
position : absolute;
font-size : 10pt;
color : blue;
visibility: hidden;
} .s2
{
position : absolute;
font-size : 18pt;
color : red;
visibility : hidden;
} .s3
{
position : absolute;
font-size : 14pt;
color : gold;
visibility : hidden;}
.s4
{
position : absolute;
font-size : 12pt;
color : lime;
visibility : hidden;
} //-->
</STYLE>

Esto entre las etiquetas <body></body>

<DIV ID="div1" CLASS="s1">*</DIV>
<DIV ID="div2" CLASS="s2">*</DIV>
<DIV ID="div3" CLASS="s3">*</DIV>
<DIV ID="div4" CLASS="s4">*</DIV> <SCRIPT LANGUAGE="javascript" TYPE="text/javascript"> /*
Script by Mike McGrath- http://website.lineone.net/~mike_mcgrath
Featured on JavaScript Kit (http://javascriptkit.com)
For this and over 400+ free scripts, visit http://javascriptkit.com
*/ var nav = (document.layers);
var tmr = null;
var spd = 50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15; if(nav) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = get_mouse; function get_mouse(e)
{
x = (nav) ? e.pageX : event.clientX+document.body.scrollLeft;
y = (nav) ? e.pageY : event.clientY+document.body.scrollTop;
x += x_offset;
y += y_offset;
beam(1);
} function beam(n)
{
if(n<5)
{
if(nav)
{
eval("document.div"+n+".top="+y);
eval("document.div"+n+".left="+x);
eval("document.div"+n+".visibility='visible'");
}
else
{
eval("div"+n+".style.top="+y);
eval("div"+n+".style.left="+x);
eval("div"+n+".style.visibility='visible'");
}
n++;
tmr=setTimeout("beam("+n+")",spd);
}
else
{
clearTimeout(tmr);
fade(4);
}
} function fade(n)
{
if(n>0)
{
if(nav)eval("document.div"+n+".visibility='hidden'");
else eval("div"+n+".style.visibility='hidden'");
n--;
tmr=setTimeout("fade("+n+")",spd);
}
else clearTimeout(tmr);
} // -->
</SCRIPT>

Pelotas Que Circulan El Cursor
Primero subi esta imagen (Imagen necesaria para el funcionamiento del script) a tu servidor y asegurate de que este en el mismo directorio que la pagina en donde pongas el script. Tambien podes crear tu propia imagen, pero asegurate de nombrarla "swirl.gif". (Sin Las Comillas)

<script LANGUAGE="JavaScript"> /*
Swirling cursor trail (By Ozone, http://ozone.com)
Featured on JavaScript Kit free JavaScripts with bug fix for IE (http://javascriptkit.com)
For full source code to this script, visit http://javascriptkit.com
*/ window.onerror=null;
netscape = (document.layers) ? 1:0;
goodIE = (document.all) ? 1:0;
document.onmousemove=MoveHandler;
var gotthere = 0;
var count = 0;
var ietopcorner=''
var ieleftcorner='' toplocation = new Array( 0,30,57,80,101,125,80,80,101,125,80,0 );
temptoplocation = new Array( 50,100,100,150,150,200,200,100,150,150,200,200,0 );
leftlocation = new Array( 0,292,318,181,181,217,263,318,181,181,217,263,-96 );
templeftlocation = new Array( 0,0,260,390,420,550,680,390,420,550,680,0 );
difftop = new Array( 0,0,0,0,0,0,0,0,0,0,0,0 );
diffleft = new Array( 0,0,0,0,0,0,0,0,0,0,0,0 );
questtop = -13;
questleft2 = -96;
if (netscape) {
document.body=new Object()
document.body.scrollTop=''
document.body.scrollLeft=''
window.captureEvents(Event.MOUSEMOVE);
window.onMouseMove = MoveHandler;
var layerstart = "document.";
var layerleft = ".left";
var layertop = ".top";
var layerstyle = "";
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight; }
else if (goodIE) {
ietopcorner=document.body.scrollTop
ieleftcorner=document.body.scrollLeft
layerstart = "document.all.";
layerleft = ".left";
layertop = ".top";
layerstyle = ".style";
windowWidth=600;
windowHeight=400; }
// end error trapping
var Ypos2 = 72;
var Xpos2 = 72;
function MoveHandler(e) {
if (netscape || goodIE) {
Xpos2 = (netscape)?e.pageX:event.x
Ypos2 = (netscape)?e.pageY:event.y
Xorigin = Xpos2;
Yorigin = Ypos2;
if (Ypos2 > windowHeight/2) {
if (Xpos2 > windowWidth/2) { direction = 1;}
else { direction = -1;} }
else {
if (Xpos2 > windowWidth/2) { direction = -1;}
else { direction = 1;} }
}} function startthedots() {
if (goodIE) {
windowWidth=document.body.clientWidth;
windowHeight=document.body.clientHeight; }
Xorigin = 204;
Yorigin = 147;
spin();run(); } var OrbitSize = 200;
count=1; delay=100; direction = -1;
Count = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
Xpoint = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
Ypoint = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
var speed = -0.06;
var offset = 1; function spin() {
for ( j = 0 ; j <= 9 ; j++ ) {
Count[j] = Count[j] + (speed*direction);
Xpoint[j] = Xorigin + ((OrbitSize*Math.sin(Count[j])*offset));
Ypoint[j] = Yorigin + (OrbitSize*Math.cos(Count[j])); }
setTimeout('spin()',3); } function run() {
count++;
for ( j = 0 ; j <= 9 ; j++ ) {
difftop[j] = Ypoint[j] - temptoplocation[j];
diffleft[j] = Xpoint[j] - templeftlocation[j];
diff = 30;
temptoplocation[j] = temptoplocation[j] + difftop[j]/diff;
templeftlocation[j] = templeftlocation[j] + diffleft[j]/diff;
eval(layerstart+"a"+j+layerstyle+layerleft+" = document.body.scrollLeft+templeftlocation["+j+"]");
eval(layerstart+"a"+j+layerstyle+layertop+" = document.body.scrollTop+temptoplocation["+j+"]"); }
setTimeout('run()', 25) } badIE = 0;
browserName = navigator.appName.substring(0,8);
browserVer = parseFloat(navigator.appVersion);
macintosh = navigator.userAgent.indexOf("Mac");
if (browserName == "Microsof") {
if (macintosh != -1) { badIE = 1; }
if (browserVer < 4) { badIE = 1; }
} </script>
<style TYPE="text/css">
<!--
#a0 {position:absolute; left:-24; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a1 {position:absolute; left:96; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a2 {position:absolute; left:216; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a3 {position:absolute; left:338; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a4 {position:absolute; left:460; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a5 {position:absolute; left:640; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a6 {position:absolute; left:-24; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a7 {position:absolute; left:200; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a8 {position:absolute; left:300; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a9 {position:absolute; left:600; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;} // -->
</style>  
<div ID="a0" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a1" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a2" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a3" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a4" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a5" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a6" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a7" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a8" align="center"><img src="swirl.gif" height="9" width="9" /></div>
<div ID="a9" align="center"><img src="swirl.gif" height="9" width="9" /></div>