phpBB Italia chiude!
phpBB Italia ringrazia tutti gli utenti che hanno dato fiducia al nostro progetto per ben 9 anni, e che, grazie al grande lavoro fatto da tutto lo Staff (rigorosamente a titolo gratuito), hanno portato il portale a diventare il principale punto di riferimento italiano alla piattaforma phpBB.

Purtroppo, causa motivi personali, non ho più modo di gestirlo e portarlo avanti. Il forum viene ora posto in uno stato di sola lettura, nonché un archivio storico per permettere a chiunque di fruire di tutte le discussioni trattate.

Il nuovo portale di assistenza per l'Italia di phpBB diventa phpBB-Store.it, cui ringrazio per aver deciso di portare avanti questo grande progetto.

Grazie ancora,
Carlo - Amministratore di phpBB Italia

Links che esplodono frasi o caratteri.

Discussioni relative al linguaggio di programmazione client side.
Rispondi
DOWGR
Utente
Utente
Messaggi: 301
Iscritto il: 25/07/2011, 22:36
Versione: 3.0.10
Server: UNIX/Linux
Contatta:

Links che esplodono frasi o caratteri.

Messaggio da DOWGR » 27/03/2012, 18:18

Immagine
questo e il loro script
rasferire il tutto nella vostra pagina web, in questo caso immediatamente prima del tag: di chiusura </body>

Codice: Seleziona tutto

<script language="JavaScript" type="text/javascript">
<!-- 
// Prelevato ed illustrato su http://www.web-link.it
// CREDITS:
// LinkExploder 3 by Peter Gehrig 
// Copyright (c) 2003 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Similar scripts can be found at http://Sito Sparito dalla rete.
// info@24fun.com
// 11/28/2003

// IMPORTANT: 
// If you add this script to a script-library or script-archive 
// you have to add a link to http://Sito Sparito dalla rete on the webpage 
// where this script will be running.

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION STARTS HERE
///////////////////////////////////////////////////////////////////////////
		
// Set the number of sparkles. Add or remove as many as you like.    
var sparklenumber=20

// Set the fonts that create the sparkles. Add or remove as many as you like.
var sparklefont=new Array("Arial","Times","Comic Sans MS")

// Set the sizes of sparkles (pixels). Add or remove as many as you like.
var sparklesize=new Array(5,10,15,20)

// Set colors of sparkles. Add or remove as many as you like.
var sparklecolor=new Array("#FF0000","#000066","#444400","#006600")

// Set the speed (higher=slower)
var speed=20

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////

// Do not edit below this line
var sparklesizeNS4=new Array()
var x_sparklepos
var y_sparklepos
var x,y
var x_random=new Array()
var y_random=new Array()
var max_explsteps=80
var i_explsteps=0
var i_color=0
var i_size=0
var i_font=0
var marginbottom
var marginright
var sparklewidth=20
var sparkleheight=20
var isloaded=false

var browserinfos=navigator.userAgent 
var ie4=document.all&&!document.getElementById&&!browserinfos.match(/Opera/)
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns4=document.layers
var ns6=!document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var opera=browserinfos.match(/Opera/)  
var browserok=ie4||ie5||ns4||ns6||opera

for (i=0;i<=sparklesize.length;i++) {
	sparklesizeNS4[i]=Math.round(sparklesize[i]/5)
	if (sparklesizeNS4[i]<1) {sparklesizeNS4[i]=1}
	if (sparklesizeNS4[i]>7) {sparklesizeNS4[i]=7}
}

function initlinkexploder() {
	isloaded=true
}

function startexplosion(whatword) {
if (isloaded) {
    i_explsteps=0
    x_sparklepos=x
    y_sparklepos=y
    for (i=0;i<=sparklenumber;i++) {
		x_random[i]=Math.ceil(20*Math.random())-10
        y_random[i]=Math.ceil(20*Math.random())-10
		while(x_random[i]>-2 && x_random[i]<2) {
        	x_random[i]=Math.ceil(20*Math.random())-10
        	y_random[i]=Math.ceil(20*Math.random())-10
		}
	}
	if (ie4) {
		marginbottom = document.body.clientHeight
		marginright = document.body.clientWidth
        for (i=0;i<=sparklenumber;i++) {
            var thisspan=eval("document.all.span"+i+".style")
            thisspan.visibility="VISIBLE"
			thisspan.posLeft=x_sparklepos
			thisspan.posTop=y_sparklepos
			var thisspan=eval("document.all.span"+i)
			thisspan.innerHTML=whatword
		}
    }
	if (ie5||opera) {
		marginbottom=document.body.clientHeight
		marginright=document.body.clientWidth
        for (i=0;i<=sparklenumber;i++) {
            var thisspan=document.getElementById("span"+i).style
            thisspan.visibility="VISIBLE"
			thisspan.left=x_sparklepos
			thisspan.top=y_sparklepos
			var thisspan=document.getElementById("span"+i)
			thisspan.innerHTML=whatword
			sparklewidth=parseInt(thisspan.offsetWidth)
			sparkleheight=parseInt(thisspan.offsetHeight)
			
		}
    }
	if (ns6) {
		marginbottom=window.innerHeight
		marginright=window.innerWidth
        for (i=0;i<=sparklenumber;i++) {
            var thisspan=document.getElementById("span"+i).style
            thisspan.visibility="VISIBLE"
			thisspan.left=x_sparklepos
			thisspan.top=y_sparklepos
			var thisspan=document.getElementById("span"+i)
			thisspan.innerHTML=whatword
			sparklewidth=parseInt(thisspan.offsetWidth)
			sparkleheight=parseInt(thisspan.offsetHeight)
		}
    }
		
    if (ns4) {
		
		marginbottom=window.innerHeight
		marginright=window.innerWidth
        for (i=0;i<=sparklenumber;i++) {
			i_color++;i_font++;i_size++;
	    	if (i_color>=sparklecolor.length) {i_color=0}
			if (i_font>=sparklefont.length) {i_font=0}
			if (i_size>=sparklesizeNS4.length) {i_size=0}
            var thisspan=eval("document.span"+i)
            thisspan.visibility="VISIBLE"
            thisspan.left=x_sparklepos
            thisspan.top=y_sparklepos
			var thisspan=eval("document.span"+i+".document")
			thisspan.write("<font face="+sparklefont[i_font]+" color="+sparklecolor[i_color]+" size="+sparklesizeNS4[i_size]+">")
			document.write(whatword)
			document.write("</font>")
			thisspan.close()
		}
    }
	explode()
}
}

function explode() {
	if (i_explsteps<=max_explsteps) {
		for (i=0;i<=sparklenumber;i++) {
			if (ie4) {
            	var thisspan=eval("document.all.span"+i+".style")
				if (thisspan.posLeft>=marginright || thisspan.posTop>=marginbottom) {
            		thisspan.posLeft=-1000
					thisspan.posTop=-1000
				}
				else {
					thisspan.visibility="VISIBLE"
            		thisspan.posLeft+=x_random[i]
            		thisspan.posTop+=y_random[i]
				}
			}
			if (ie5||ns6||opera) {
			 	var thisspan=document.getElementById("span"+i).style
				if (parseInt(thisspan.left)>=marginright-sparklewidth-30+document.body.scrollLeft || parseInt(thisspan.top)>=marginbottom-sparkleheight-20+document.body.scrollTop) {
            		thisspan.left=-1000
					thisspan.top=-1000			
				}
				else {
					thisspan.visibility="VISIBLE"
					thisspan.left=parseInt(thisspan.left)+x_random[i]
					thisspan.top=parseInt(thisspan.top)+y_random[i]
				}	
			}
			if (ns4) {
				var thisspan=eval("document.span"+i)
				thisspan.visibility="VISIBLE"
				thisspan.left+=x_random[i]
            	thisspan.top+=y_random[i]
			}
		}
		i_explsteps++
		var timer=setTimeout("explode()",speed)
	}
	else {
		for (i=0;i<=sparklenumber;i++) {
			if (ie4) {var thisspan=eval("document.all.span"+i+".style")}
			if (ie5||ns6||opera) {var thisspan=document.getElementById("span"+i).style}
			if (ns4) {var thisspan=eval("document.span"+i)}
	        thisspan.visibility="HIDDEN"
		}
		clearTimeout(timer)
	}
}

function handlerMM(e){
	x = (ns4||ns6) ? e.pageX : document.body.scrollLeft+event.clientX
	y = (ns4||ns6) ? e.pageY : document.body.scrollTop+event.clientY
}

if (ns4){
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove=handlerMM;

document.write("<style>")
document.write(".spanstyle {")
document.write("position:absolute;")
document.write("visibility:hidden;")
document.write("}")
document.write("</style>")

for (i=0;i<=sparklenumber;i++) {
	if (ie4||ie5||ns6||opera) {
    	document.write("<div id='span"+i+"' class='spanstyle' style='font-family:"+sparklefont[i_font]+";font-size:"+sparklesize[i_size]+"px;color:"+sparklecolor[i_color]+";'>")
    	document.write(".")
    	document.write("</div>")
    	i_color++;i_font++;i_size++;
    	if (i_color>=sparklecolor.length) {i_color=0}
		if (i_font>=sparklefont.length) {i_font=0}
		if (i_size>=sparklesize.length) {i_size=0}
	}
	if (ns4) {
    	document.write("<div id='span"+i+"' class='spanstyle'>")	
		document.write("<font face="+sparklefont[i_font]+" color="+sparklecolor[i_color]+" size="+sparklesizeNS4[i_size]+">")
    	document.write("....")
		document.write("</font>")
    	document.write("</div>")
    	i_color++;i_font++;i_size++;
    	if (i_color>=sparklecolor.length) {i_color=0}
		if (i_font>=sparklefont.length) {i_font=0}
		if (i_size>=sparklesizeNS4.length) {i_size=0}
	}
}
if (browserok) {
	window.onload=initlinkexploder
}
// end  -->
</script>
Passo 2:

Adesso si deve aggiungere ai vari links il comando onMouseOver che richiama l'effetto.

Codice: Seleziona tutto

<a href="http://www.web-link.it" onMouseOver="startexplosion('love')">tuo Link</a>
IMPORTANTE: Non inserire il codice in tabelle o all'interno di tags <DIV> e </DIV> non funzionerebbe vista la struttura dello script!
non riesco proprio a capire i percorsi giusti vorrei creare una scritta nel index del forum esempio clicca qua appena vai su col mauss e spolodono

Avatar utente
Barrnet
Leader Moderatori
Leader Moderatori
Messaggi: 3124
Iscritto il: 04/07/2010, 23:31
Sesso: Maschio
Versione: 3.0.10
Server: UNIX/Linux
PHP: 5.3.10
Database: MySQL 5.1.61-community-log
Contatta:

Re: Links che esplodono frasi o caratteri.

Messaggio da Barrnet » 27/03/2012, 22:57

Dovresti cercare nel template del viewtopic la parte che trasforma in url e inserirgli quella classe.

DOWGR
Utente
Utente
Messaggi: 301
Iscritto il: 25/07/2011, 22:36
Versione: 3.0.10
Server: UNIX/Linux
Contatta:

Re: Links che esplodono frasi o caratteri.

Messaggio da DOWGR » 28/03/2012, 5:51

barnet come sempre non ho parole e bastato un mp che ti ho inviato e subito mi hai risposto grazie
solo che per te ovviamente e facile io ho qualche problemino saresti cosi gentile da piazzarmi il codice gia pronto ;)

Avatar utente
Lady R
phpBB Expert
phpBB Expert
Messaggi: 900
Iscritto il: 08/11/2011, 13:43
Sesso: Femmina
Versione: 3.0.9
Server: UNIX/Linux
PHP: 5.3.8
Database: MySQLi
Contatta:

Re: Links che esplodono frasi o caratteri.

Messaggio da Lady R » 28/03/2012, 15:22

basta jquery


$('a').hover( function() { codice dello script });

e si applica a tutti i link

DOWGR
Utente
Utente
Messaggi: 301
Iscritto il: 25/07/2011, 22:36
Versione: 3.0.10
Server: UNIX/Linux
Contatta:

Re: Links che esplodono frasi o caratteri.

Messaggio da DOWGR » 28/03/2012, 19:38

lady non ho proprio idea su come si faccia

Avatar utente
Lady R
phpBB Expert
phpBB Expert
Messaggi: 900
Iscritto il: 08/11/2011, 13:43
Sesso: Femmina
Versione: 3.0.9
Server: UNIX/Linux
PHP: 5.3.8
Database: MySQLi
Contatta:

Re: Links che esplodono frasi o caratteri.

Messaggio da Lady R » 29/03/2012, 12:17

inlcudi jquery

scrivi quel codice che ti ho scritto dentro a <script> </script> nell'overall header

Rispondi

Torna a “JavaScript”

Chi c’è in linea

Visitano il forum: Nessuno e 31 ospiti