speed Admin
Messaggi : 418 Occupazione/Hobby : Studente di Informatica
| Titolo: [html - css] codice sorgente per la scritta sul puntatore. 26/1/2011, 7:13 pm | |
| qualcuno ha idea di quale sia il codice da inserire in html o in css per generare una scritta che segua continuamente il puntatore all'interno del forum? grazie per i suggerimenti! buona serata! | |
|
HyperTesto Intermedio
Messaggi : 53 Occupazione/Hobby : La FI*A
| Titolo: Re: [html - css] codice sorgente per la scritta sul puntatore. 26/1/2011, 8:13 pm | |
| con i css sono una frana, ma credo sia direttamente possibile con l'html... almeno spero... | |
|
Elkyr94 Principiante
Messaggi : 42
| Titolo: Re: [html - css] codice sorgente per la scritta sul puntatore. 26/1/2011, 9:09 pm | |
| Qualcosa tipo questo? - Codice:
-
<html> <head> <title>Pagina di prova</title> <script type="text/javascript"> function xcoord(e) { if(e.pageX) { return e.pageX; } else if(e.clientX) { return e.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft); } else { return null; } } function ycoord(e) { if(e.pageY) { return e.pageY; } else if(e.clientX) { return e.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop); } else { return null; } } function moved(e) { var d=document.getElementById("testo"); d.style.top=ycoord(e)+5; d.style.left=xcoord(e)+5; } </script> </head> <body onmousemove="moved(event);"> <div id="testo" style="position:absolute;">Testo di prova</div> </body> </html> Però è fatto in Javascript...in CSS non lo so, è tanto che non lo utilizzo, e non sono mai stato particolarmente esperto. | |
|
Apache93 Esperto
Messaggi : 126 Occupazione/Hobby : Batterista Umore : Stay Rock! \m/
| Titolo: Eccotelo 27/1/2011, 1:25 pm | |
| Eccotelo: - Codice:
-
<script type="text/javascript"> /* Cursor Trailer Text- By Peter Gehrig (http://www.24fun.ch/) Grazie a Dynamic Drive: http://www.dynamicdrive.com/dynamicindex13/trailortext.htm Ottimizzato e reso compatibile con Forumfree da DarkStyle (C) 2009 http://ffmagazine.forumfree.net */ var x,y; var flag = 0; var offPos = 15; //Distanza dal cursore var trailerSpeed = 'medium'; //'slow', 'medium', 'fast' o valore numerico - Velocità del fade // Il tuo messaggio in array (Forum free : var trailerMessage = new Array("F", "o", "r", "u", "m", " ", "F", "r", "e", "e"); ) var trailerMessage = new Array("R", "o", "c", "k", "!"); switch(trailerSpeed) {case 'medium':trailerSpeed=30;break; case 'slow':trailerSpeed=50;break; case 'fast':trailerSpeed=10;break;} var ind = new function() {this.i = 0;}; var xpos = new Array(); for (i = 0; i < trailerMessage.length; i++) {ind.i = i; xpos[ind.i] = -50;} var ypos = new Array(); for (i = 0; i < trailerMessage.length; i++) {ind.i = i; ypos[ind.i] = -50;}var IE = document.all ? true : false; if (!IE) document.captureEvents(Event.MOUSEMOVE); document.onmousemove = function(e) { if (IE) {x = event.clientX + document.body.scrollLeft; y = event.clientY + document.body.scrollTop;} else {x = e.pageX; y = e.pageY;} x = x < 0 ? 0 : x; y = y < 0 ? 0 : y; flag = 1;}; function makesnake() {if (flag == 1 && IE) {for (i = trailerMessage.length-1; i >= 1; i--) {ind.i = i; xpos[ind.i] = xpos[ind.i - 1] + offPos; ypos[ind.i] = ypos[ind.i - 1];} xpos[0] = x + offPos; ypos[0] = y + offPos; for (i = 0; i < trailerMessage.length; i++) {ind.i = i; var thisspan = document.getElementById('span' + ind.i).style; thisspan.posLeft = xpos[ind.i]; thisspan.posTop = ypos[ind.i];}} else if (flag == 1 && !IE) {for (i = (trailerMessage.length - 1); i >= 1; i--) {ind.i = i; xpos[ind.i] = xpos[ind.i - 1] + offPos; ypos[ind.i] = ypos[ind.i - 1];} xpos[0] = x + offPos; ypos[0] = y + offPos; for (i = 0; i < trailerMessage.length; i++) {ind.i = i; var thisspan = document.getElementById('span' + ind.i); thisspan.style.left = xpos[ind.i]; thisspan.style.top = ypos[ind.i];}} var timer = setTimeout("makesnake()", trailerSpeed);}for (i=0;i<=trailerMessage.length-1;i++) {ind.i = i; trailerMessage[ind.i] = trailerMessage[ind.i] == ' ' ? ' ' : trailerMessage[ind.i]; document.write('<span id="span' + ind.i + '" class="spanstyle">' + trailerMessage[ind.i] + '</span>');} window.onload = makesnake(); var body = document.body ? document.body : (document.activeElement ? document.activeElement : 0); if(body) {body.style.overflowX = 'hidden'; body.style.overflowY = 'auto'; body.style.minHeight = 0; body.style.width = '100%';} </script> Leggi i commenti sopra le lettere che compongono la parola Rock | |
|
speed Admin
Messaggi : 418 Occupazione/Hobby : Studente di Informatica
| Titolo: Re: [html - css] codice sorgente per la scritta sul puntatore. 27/1/2011, 3:42 pm | |
| ringrazio tutti voi per l'aiuto, a presto! | |
|
Contenuto sponsorizzato
| Titolo: Re: [html - css] codice sorgente per la scritta sul puntatore. | |
| |
|