Texto que sigue al cursor – PHD – Texas – Habitaciones

Para quienes han tenido problemas con el truco delcursor con texto en movimiento les daré otro código. Este al igual que el anterior hará que un texto persiga al cursor, sin embargo este tiene un efecto más suave al ondularse el texto. Puedes verlo funcionando eneste blog de pruebas.

Entra enDiseño Edición de HTML y antes de/head pega lo siguiente:
script language='javascript' type='text/javascript'
//Cursor con texto en movimiento

//![CDATA[
var x,y
var tempo = 10
var espera = 0

var texto = "Aquí va tu texto"

texto = texto.split("")

var xpos = new Array()
for (i = 0; i = texto.length - 1; i++) {
xpos[i] = -50
}
var ypos = new Array()
for (i = 0; i = texto.length - 1; i++) {
ypos[i] = -50
}

function seguir(e){

//si no es NS4, usa objeto window.event
if (!e) var e = window.event

//NS4
if (e.pageX || e.pageY) {
x = e.pageX
y = e.pageY
window.status = x + ' : ' + y
//IE y compatibles con DOM
} else if (e.clientX || e.clientY) {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop
window.status = x + ' : ' + y
//no soportado, no hace nada
} else {
return
}

espera = 1
}

function animar_cursor() {

if ( espera == 1 ) {
for ( i = texto.length - 1; i = 1; i--) {
xpos[i] = xpos[i-1] + tempo
ypos[i] = ypos[i-1]
}
xpos[0] = x + tempo
ypos[0] = y
}

//para el IE 4.x
if ( espera==1 && document.all ) {
for (i = 0; i = texto.length - 1; i++) {
var letra = eval("span" + i + ".style")
letra.posLeft = xpos[i]
letra.posTop = ypos[i]
}
}
//para el Netscape 4.x
else if ( espera==1 && document.layers ) {
for (i = 0; i = texto.length - 1; i++) {
var letra = eval("document.span" + i)
letra.left = xpos[i]
letra.top = ypos[i]
}
}

//para navegadores compatibles DOM
else if ( espera==1 && document.getElementById ) {

for (i = 0; i = texto.length - 1; i++) {
var letra = document.getElementById( "span" + i)

letra.style.left = xpos[i] + 'px'
letra.style.top = ypos[i] + 'px'
}
}

var timer = setTimeout("animar_cursor()", 30)
}

if (document.layers)
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = seguir
//
/script
style type='text/css'
.cursoranimado {
position:absolute;
visibility:visible;
top:-50px;
font-size:11pt;
font-family:Arial;
font-weight:bold;
color:red;
}
/style
script language='javascript' type='text/javascript'
//![CDATA[
if (document.layers) {
for (i=0;i=texto.length-1;i++) {
document.write('span id="span' + i + '" class="cursoranimado"')
document.write(texto[i])
document.write('/span')
}
} else if (document.all || document.getElementById) {
for (i=0;i=texto.length-1;i++) {
document.write('div id="span' + i + '" class="cursoranimado"')
document.write(texto[i])
document.write('/div')
}
}
animar_cursor()
//
/script

Sólo cambia lo que está enrojo por el texto que quieres que aparezca junto al cursor. Enfont-size puedes cambiar el tamaño del texto y encolor para cambiar el color de las letras.

low credit line credit cards Hire php programmers Mobile casino motorcycle accident lawyer san diego Business VOIP Solutions Criminal lawyer Miami mesothelioma settlements amounts Asbestos Lung Cancer mesothelioma law suits Automobile Accident Attorney EMAIL BULK SERVICE anti spam appliance Online Colleges personal injury law firm CHEAP CAR INSURANCE IN VIRGINIA attorney lawyer mesothelioma structured settlement buyers Social media platforms for business att call conference Online casino Live casino buy structured settlements Forensics online course Casino illinois law lemon Bankruptcy lawyer Make money online Australia Donate a Car in Maryland Cheap car insurance for ladies Casino reviews Donate Your Car Sacramento Criminal defense lawyer Online Christmas cards Donate your Car for Money los angeles motorcycle accident lawyer See more at http//wwwginfostopnet/ personal injury attorney ocala fl DUI lawyer Psd to WordPress injury lawyers west palm beach domain registration yahoo paperport promotional code Holland Michigan College Hire php developers structure settlements Social media examiner DONATING USED CARS TO CHARITY new mexico mesothelioma lawyer yahoo web hosting california mesothelioma attorney Best Seo company Donate Old Cars to Charity Met Auto Business finance group personal injury firm Psd to html Dwi lawyer Auto Mobile Shipping Quote michigan motorcycle accident lawyer Criminal lawyer Service business software mesotheliama Sell Annuity Payment Seo company Mesothelioma Law Firm structured settlemen Php programmers for hire Hire php developer Seo companies Christmas cards Paperport Promotional Code sell my structured settlement car accident lawyer in san diego Custom WordPress theme designer Computer science classes online Donate cars Illinois NUNAVUT CULTURE mesothelioma attorneys california Php programmers Donate Your Car for Kids CHEAP AUTO INSURANCE IN VA meso lawyer benchmark lending Proud Italian cook mesothelioma settlements LIFE INSURANCE CO LINCOLN structured settlement sell Best social media platforms for business Tech school sell structured settlement calculator Futuristic Architecture houston tx auto insurance Donate your car Sacramento Cheap Car Insurance in Virginia colorado auto accident attorney New social media platforms baltimore mesothelioma attorneys semi truck accident lawyers ROYALTY FREE IMAGES STOCK Social media campaigns DONATE YOUR CAR FOR MONEY MORTGAGE ADVISER Photo Christmas cards Personal Injury Lawyers Life insurance co Lincoln truck accident attorney los angeles Register Free Domains refinance with poor credit Seo services Business management software Best social media platforms mesothelioma claim primary pulmonary hypertension Custom Christmas cards Donate Car to Charity California

Share: