Coleccion de codigos
:: Tutoriales :: Tutoriales PWG
Página 1 de 1.
Coleccion de codigos
TEXTO ROTATIVO
MARQUESINA DE TEXTO
TRANSICIONES DE PAGINAS
Código:
MENSAJE SOBRE TEXTO AL TRANSCURRIR SEGUNDOS
PUNTERO CAMBIA SEGUN DIRECCIÓN DEL MOUSE
TEXTO ROTANDO SOBRE EL PUNTERO DEL RATON
TEXTO CON EFECTO DE MECANOGRAFIA
- Código:
<script>
Phrase="AQUI PON TU TEXTO QUE QUIERAS"
Balises=""
Taille=25;
Midx=-50;
Decal=0.25;
Nb=Phrase.length;
y=-500;
for (x=0;x<Nb;x++){
Balises=Balises + '<DIV>' + Phrase.charAt(x) + '</DIV>'
}
document.write (Balises);
Time=window.setInterval("Alors()",35);
Alpha=5;
I_Alpha=0.05;
function Alors(){
Alpha=Alpha-I_Alpha;
for (x=0;x<Nb;x++){
Alpha1=Alpha+Decal*x;
Cosine=Math.cos(Alpha1);
Ob=document.all("L"+x);
Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+600;
Ob.style.zIndex=10*Cosine;
Ob.style.fontSize=Taille+1*Cosine;
Ob.style.color="rgb("+ (99+Cosine*99+11) + ","+ (11+Cosine*11+00) + ",99)";
}
}
</script>
MARQUESINA DE TEXTO
- Código:
<p><b><font color="#FFFFFF" face="Verdana" size="2">
<marquee>AQUI PON TU TEXTO QUE QUIERAS</marquee></font></b></p>
TRANSICIONES DE PAGINAS
Código:
- Código:
<meta><meta>
MENSAJE SOBRE TEXTO AL TRANSCURRIR SEGUNDOS
- Código:
<script>
var WAIT_IN_MSECS=3000; /* 3 seconds */
var timer=null;
function doIt(_v)
{
if(_v)
{
timer=setTimeout('doAction()',WAIT_IN_MSECS);
}
else
{
if(timer)
{
clearTimeout(timer);
timer=null;
}
}
}
function doAction()
{
alert("AQUI PON EL TEXTO QUE QUIERAS CUANDO PONGA EL MOUSE SOBRE EL TEXTO");
}
</script>
PUNTERO CAMBIA SEGUN DIRECCIÓN DEL MOUSE
- Código:
<script>
<!-- Begin
var x, y, xold, yold, xdiff, ydiff;
var dir = Array();
dir[0] = "n-resize";
dir[1]="ne-resize";
dir[2]="e-resize";
dir[3]="se-resize";
dir[4] = "s-resize";
dir[5]="sw-resize";
dir[6]="w-resize";
dir[7]="nw-resize";
document.onmousemove = FindXY;
function display(direction) {
document.body.style.cursor = dir[direction];
}
function FindXY(loc) {
x = (document.layers) ? loc.pageX : event.clientX;
y = (document.layers) ? loc.pageY : event.clientY;
xdiff = x - xold;
ydiff = y - yold
if ((xdiff < 2) && (ydiff < -2)) display(0);
if ((xdiff <2> 2)) display(4);
if ((xdiff > 2) && (ydiff < 2)) display(2);
if ((xdiff < -2) && (ydiff <2> 2) && (ydiff > 2)) display(3);
if ((xdiff > 2) && (ydiff < -2)) display(1);
if ((xdiff <2> 2)) display(5);
if ((xdiff < -2) && (ydiff <2>
</script>
TEXTO ROTANDO SOBRE EL PUNTERO DEL RATON
- Código:
<script>
<!-- Begin
if (document.all) {
//Escribe aquí el texto que quieres
yourLogo = "AQUI PON TU TEXTO QUE QUIERAS"; //Más de 2 letras
logoFont = "Verdana";
logoColor = "336699";
//No tienes que modificar nada mas
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 100;
logoHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('<div id="outer"><div>');
for (i = 0; i < L; i++) {
document.write('<div id="ie">'+yourLogo[i]+'</div>');
}
document.write('</div></div>');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i < L; i++) {
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);
Sz[i] = ie[i].style.pixelTop - ypos;
if (Sz[i] <5>
</script>
TEXTO CON EFECTO DE MECANOGRAFIA
- Código:
<script><!--
//Secify scroller contents
var line=new Array()
line[1]="AQUI PON TU TEXTO QUE QUIERAS"
line[2]="AQUI PON TU TEXTO QUE QUIERAS"
line[3]="AQUI PON TU TEXTO QUE QUIERAS"
line[4]="AQUI PON TU TEXTO QUE UQIERAS"
line[5]="AQUI PON TU TEXTO QUE QUIERAS"
line[6]="AQUI PON TU TEXTO QUE QUIERAS"
//Specify font size for scoller
var ts_fontsize="12px"
//--Don't edit below this line
var longestmessage=1
for (i=2;i<line>line[longestmessage].length)
longestmessage=i
}
//Auto set scroller width
var tscroller_width=line[longestmessage].length
lines=line.length-1 //--Number of lines
//if IE 4+ or NS6
if (document.all||document.getElementById){
document.write('<form>')
document.write('<input>')
document.write('</form>')
}
temp=""
nextchar=-1;
nextline=1;
cursor="]"
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",3000)}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else{
nextstep()}}
function nextstep(){
if (cursor=="\\"){
cursor="|"}
else if (cursor=="|"){
cursor="/"}
else if (cursor=="/"){
cursor="-"}
else if (cursor=="-"){
cursor="\\"}
nextchar++;
temp+=line[nextline].charAt(nextchar);
document.bannerform.banner.value=temp+cursor
setTimeout("animate()",25)}
//if IE 4+ or NS6
if (document.all||document.getElementById)
window.onload=animate
// --></script>
otros codes
TEXTO ESTELAR
TEXTO LATIENDO
VENTANA LOCA
RELOJ SIEMPRE VISILBE
TEXTO CON FUEGO
Se activa con solo pasar el mouse por encima de el, ahi les va.
Este codigo muestra un reloj y fecha alrededor del raton:
- Código:
<span id="theText">
<h3><font color="#3a6ca3"><font size="+5">AQUI PON TU TEXTO QUE QUIERAS</font>
</font><font color="#666666">
<script> // ^-the text that will be displayed
<!--
//can be edited from here
var from = 5; //the animation start value
var to = 11; //the animation end value
var delay = 55; //the animation speed
var glowColor = "red"; //the first color
var glowColor2 = "orange"; //the second color
var glowColor3 = "yellow"; //the third color
var glowColor4 = "lime"; //4th color
var glowColor5 = "blue"; //5th color
var glowColor6 = "magenta"; //last color
//no more editing
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i <to> from)
{
theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
}
function textPulseUp2()
{
if (!document.all)
return
if (i <to> from)
{
theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
}
function textPulseUp3()
{
if (!document.all)
return
if (i <to> from)
{
theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script></font></h3></span>
TEXTO LATIENDO
- Código:
<span id="TexteBat">
<h1>AQUI PON EL TEXTO QUE QUIERAS</h1>
</span>
</center>
<script>
<!--
var from = 4;
var to = 12;
var delay = 55;
var glowColor = "#00FF00";
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i <to> from)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script>
VENTANA LOCA
- Código:
<script>
<Begin> 0; t--) {
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,-x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(x,0);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(-x,0);
}
}
}
//-->
// End -->
</script>
RELOJ SIEMPRE VISILBE
- Código:
<script>
//Static analog Clock by kurt.grigg@virgin.net
fCol='000000';//face colour.
sCol='ff0000';//seconds colour.
mCol='000000';//minutes colour.
hCol='000000';//hours colour.
H='....';
H=H.split('');
M='.....';
M=M.split('');
S='......';
S=S.split('');
Ypos=0;
Xpos=0;
Ybase=8;
Xbase=8;
dots=12;
ns=(document.layers)?1:0;
if (ns){
dgts='1 2 3 4 5 6 7 8 9 10 11 12';
dgts=dgts.split(' ')
for (i=0; i < dots; i++){
document.write('<layer><center><font color='+fCol+'>'+dgts[i]+'</font></center></layer>');
}
for (i=0; i < M.length; i++){
document.write('<layer></layer>');
}
for (i=0; i < H.length; i++){
document.write('<layer></layer>');
}
for (i=0; i < S.length; i++){
document.write('<layer></layer>');
}
}
else{
document.write('<div><div>');
for (i=1; i < dots+1; i++){
document.write('<div id="ieDigits">'+i+'</div>');
}
document.write('</div></div>')
document.write('<div><div>');
for (i=0; i < M.length; i++){
document.write('<div></div>');
}
document.write('</div></div>')
document.write('</div></div>')
document.write('<div><div>');
for (i=0; i < H.length; i++){
document.write('<div></div>');
}
document.write('</div></div>')
document.write('<div><div>');
for (i=0; i < S.length; i++){
document.write('<div></div>');
}
document.write('</div></div>')
}
function clock(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360;
if (ns){
Ypos=window.pageYOffset+window.innerHeight-60;
Xpos=window.pageXOffset+window.innerWidth-80;
}
else{
Ypos=document.body.scrollTop+window.document.body.clientHeight-60;
Xpos=document.body.scrollLeft+window.document.body.clientWidth-60;
}
if (ns){
for (i=0; i < dots; ++i){
document.layers["nsDigits"+i].top=Ypos-5+40*Math.sin(-0.49+dots+i/1.9);
document.layers["nsDigits"+i].left=Xpos-15+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
document.layers["nx"+i].top=Ypos+i*Ybase*Math.sin(sec);
document.layers["nx"+i].left=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
document.layers["ny"+i].top=Ypos+i*Ybase*Math.sin(min);
document.layers["ny"+i].left=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
document.layers["nz"+i].top=Ypos+i*Ybase*Math.sin(hrs);
document.layers["nz"+i].left=Xpos+i*Xbase*Math.cos(hrs);
}
}
else{
for (i=0; i < dots; ++i){
ieDigits[i].style.pixelTop=Ypos-15+40*Math.sin(-0.49+dots+i/1.9);
ieDigits[i].style.pixelLeft=Xpos-14+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
x[i].style.pixelTop =Ypos+i*Ybase*Math.sin(sec);
x[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
y[i].style.pixelTop =Ypos+i*Ybase*Math.sin(min);
y[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i <H>
</script>
TEXTO CON FUEGO
- Código:
<script>
function ShadowWave()
{
if(document.getElementById && window.print)
{
var dir=Math.random();
if (dir<.1) {dir=90}
if (dir<.37) {dir=45}
if (dir<.64) {dir=315}
if (dir<.74) {dir=270}
if (dir<2) {dir=0}
document.getElementById("ejs_brouille").style.filter="shadow(color=#FFCC00,direction="+dir+",enabled=1)";
}
}
</script>
<DIV ID="ejs_brouille">
<font face="Verdana, Arial, Helvetica, sans-serif" size="5"><strong>Texto de ejemplo</strong></font></DIV>
<script>
setInterval("ShadowWave()",50);
</script>
Se activa con solo pasar el mouse por encima de el, ahi les va.
- Código:
<a href="URL DE LA PAGINA A ENLAZAR" onmouseover="window.location=this.href">NOMBRE DEL SITIO</a>
Este codigo muestra un reloj y fecha alrededor del raton:
- Código:
<td width="100%"><script language="Javascript">
dCol='FF0000';//date colour.
fCol='6800D0';//face colour.
sCol='FF0000';//seconds colour.
mCol='FF0000';//minutes colour.
hCol='009900';//hours colour.
ClockHeight=70;
ClockWidth=70;
ClockFromMouseY=60;
ClockFromMouseX=380;
//Alter nothing below! Alignments will be lost!
d=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","SABADO");
m=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DECIEMBRE");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Verdana';
size=4;
speed=0.5;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
}
for (i=0; i < H.length; i++){
var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < M.length; i++){
var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < S.length; i++){
var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < D.length; i++){
var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
}
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
</script>
<p> </td>
mas y mas codigos
Este es un reloj en la parte inferior que se queda siempre visible:
TEXTO SIGUE AL RATON:
TEXTO HORIZONTAL:
MENSAJE CON RATON:
PALABRAS EN MOVIMIENTO:
TEXTO EN DIAGONAL:
FECHA EN SUPERIOR:
TEXTO FLOTANDO:
FORMULARIO 1:
FORMULARIO 2:
- Código:
<script language="Javascript">
//Static analog Clock by kurt.grigg@virgin.net
fCol='000000';//face colour.
sCol='ff0000';//seconds colour.
mCol='000000';//minutes colour.
hCol='000000';//hours colour.
H='....';
H=H.split('');
M='.....';
M=M.split('');
S='......';
S=S.split('');
Ypos=0;
Xpos=0;
Ybase=8;
Xbase=8;
dots=12;
ns=(document.layers)?1:0;
if (ns){
dgts='1 2 3 4 5 6 7 8 9 10 11 12';
dgts=dgts.split(' ')
for (i=0; i < dots; i++){
document.write('<layer name=nsDigits'+i+' top=0 left=0 height=30 width=30><center><font face=Arial,Verdana size=1 color='+fCol+'>'+dgts[i]+'</font></center></layer>');
}
for (i=0; i < M.length; i++){
document.write('<layer name=ny'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>');
}
for (i=0; i < H.length; i++){
document.write('<layer name=nz'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>');
}
for (i=0; i < S.length; i++){
document.write('<layer name=nx'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>');
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=1; i < dots+1; i++){
document.write('<div id="ieDigits" style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial,Verdana;font-size:10px;color:'+fCol+';text-align:center;padding-top:10px">'+i+'</div>');
}
document.write('</div></div>')
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++){
document.write('<div id=y style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>');
}
document.write('</div></div>')
document.write('</div></div>')
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++){
document.write('<div id=z style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>');
}
document.write('</div></div>')
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++){
document.write('<div id=x style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>');
}
document.write('</div></div>')
}
function clock(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360;
if (ns){
Ypos=window.pageYOffset+window.innerHeight-60;
Xpos=window.pageXOffset+window.innerWidth-80;
}
else{
Ypos=document.body.scrollTop+window.document.body.clientHeight-60;
Xpos=document.body.scrollLeft+window.document.body.clientWidth-60;
}
if (ns){
for (i=0; i < dots; ++i){
document.layers["nsDigits"+i].top=Ypos-5+40*Math.sin(-0.49+dots+i/1.9);
document.layers["nsDigits"+i].left=Xpos-15+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
document.layers["nx"+i].top=Ypos+i*Ybase*Math.sin(sec);
document.layers["nx"+i].left=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
document.layers["ny"+i].top=Ypos+i*Ybase*Math.sin(min);
document.layers["ny"+i].left=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
document.layers["nz"+i].top=Ypos+i*Ybase*Math.sin(hrs);
document.layers["nz"+i].left=Xpos+i*Xbase*Math.cos(hrs);
}
}
else{
for (i=0; i < dots; ++i){
ieDigits[i].style.pixelTop=Ypos-15+40*Math.sin(-0.49+dots+i/1.9);
ieDigits[i].style.pixelLeft=Xpos-14+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
x[i].style.pixelTop =Ypos+i*Ybase*Math.sin(sec);
x[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
y[i].style.pixelTop =Ypos+i*Ybase*Math.sin(min);
y[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
z[i].style.pixelTop =Ypos+i*Ybase*Math.sin(hrs);
z[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(hrs);
}
}
setTimeout('clock()',50);
}
if (document.layers || document.all) window.onload=clock;
//-->
</script>
TEXTO SIGUE AL RATON:
- Código:
<html>
<head>
<style>
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:9pt;
font-family:Tahoma;
font-weight:bold;
color:blue;
}
</style>
<script>
var x,y
var step=20
var flag=0
// Tienes que dejar un espacio al final de tu mensaje!!!!!
var message="Tu mensaje va aqui... "
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",30)
}
</script>
</head>
<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll">
</body>
<script>
<!-- Beginning of Javascript -
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
// - End of Javascript - -->
</script>
TEXTO HORIZONTAL:
- Código:
<script LANGUAGE="Javascript">
var txt=" [ T R U C O S W E B ] - http://www.fagoco.com -";
var espera=200;
var refresco=null;
function rotulo_title() {
document.title=txt;
txt=txt.substring(1,txt.length)+txt.charAt(0);
refresco=setTimeout("rotulo_title()",espera);}
rotulo_title();
</script>
MENSAJE CON RATON:
- Código:
<script Language="Javascript">
function winopen () {
msg=open("","NewWindow","toolbar=no,location=no,
directories=no,status=no,menubar=no,scrollbars=no,
resizable=no,copyhistory=yes,width=150,height=150");
msg.location = "nuevaventana.htm"
}
</script>
PALABRAS EN MOVIMIENTO:
- Código:
<script languague="Javascript">
<!--
var cuenta=0
var texto=" Lo que te de la gana "
function scrolltexto () {
window.status=texto.substring (cuenta,texto.length)+ texto.substring(0,cuenta)
if (cuenta <texto.length){ cuenta ++
}else{
cuenta=0
}
setTimeout("scrolltexto()",150)
}
scrolltexto ()
//-->
</script>
TEXTO EN DIAGONAL:
- Código:
<!-- Visita la web de Jagoper -->
<script language=Javascript>
<!-- Beginning of Javascript -
// script trouvé sur http://www.sitecrea.fr.st tout pour votre site
// le réalisateur :
// CREDITS:
// First diagonal textscroller worldwide by Urs Dudli and Peter Gehrig
// Copyright (c) 1999 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.ch.
// info@24fun.ch
// 1/4/2000
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a link to http://www.24fun.ch on the webpage
// where First diagonal textscroller worldwide will be running.
if (document.layers) {
alert("Explorer seulement")
}
//vous mettez ci-dessous tout les textes que vous voulez (en rajoutant un nombre après "message [")
var message = new Array()
message[0]="AQUI VA UNA FRASE"
message[1]="UN SEGUNDO TEXTO AQUI"
message[2]="PUEDES CONTINUAR"
message[3]="INSERTANDO MAS FRASES"
message[4]="SON ILIMITADAS"
message[5]="SI UTILIZAS ESTE script"
message[6]="NO OLVIDES"
message[7]="PONER UN LINK"
message[8]="A LA WEB DE JAGOPER"
message[9]="NOSOTROS"
message[10]="TE LO AGRADECERIAMOS MUCHO"
message[11]="GRACIAS POR TU VISITA"
message[12]="VUELVE A VISITARNOS"
message[13]="MUCHAS GRACIAS"
var i_message=0
var scrollerheight=250
var scrollerwidth=400
var startheight=0
var font_size=25
var font_family="Times"
var timer
function initiate() {
document.all.rotationstyle.style.posLeft=-(Math.floor(scrollerwidth/2))+font_size
document.all.rotationstyle.style.posTop=startheight
startscroll()
}
function startscroll() {
if (document.all) {
do_rotate="yes"
rotationstyle.filters[0].apply()
rotationstyle.innerHTML=
'<OBJECT ID="rotationobj" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(0,0,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[i_message]+'\', 0, 0, 0)">'+
'</OBJECT>'
rotationstyle.filters[0].play()
rotationobj.Rotate(0,0,-45)
i_message++
if (i_message>=message.length) {i_message=0}
timer=setTimeout("startscroll()",4000)
}
}
function stopscroll() {
do_rotate="no"
}
// - End of Javascript - -->
</script>
FECHA EN SUPERIOR:
- Código:
<script Language="Javascript">
<!--
var today = new Date()
var year = today.getYear()
if(year<1000) year+=1900
document.title="Titulo de la pagina "+"("+today.getDate() + "." + (today.getMonth()+1) + "." + (year+"").substring(2,4)+")"
//-->
</script>
</head>
TEXTO FLOTANDO:
- Código:
<script language="Javascript">
<!--
done = 0;
step = 4
function anim(yp,yk)
{
if(document.layers) document.layers["texto"].top=yp;
else document.all["texto"].style.top=yp;
if(yp>yk) step = -4
if(yp<60) step = 4
setTimeout('anim('+(yp+step)+','+yk+')', 35);
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.texto.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else {
texto.style.left=11;
anim(60,document.body.offsetHeight - 60)
}
}
// --></script>
<div id="texto" style="position: absolute; top: -50; color: #FF8000; font-family: Arial, Helvetica; font-weight:bold; font-size:40px;">
<p><font face="Arial, Helvetica, sans-serif" size="3"><b><font size="6" color="#990000">Saludos de Fagoco</font></b></font></p>
</div>
<script language="Javascript">
<!--
setTimeout('start()',10);
//-->
</script>
FORMULARIO 1:
- Código:
<!-- comienza Response-O-Matic mensaje implementado según http://www.jagoper.com modifique con los datos de su email y su página y según su diseño (se recomienda encriptar el email). Pegar en BODY, más datos en www.response-o-matic.com -->
<FORM action=http://www.jagoper.com/principal.htm method=post>
<INPUT name=your_email_address type=hidden value="tucorreoelectrónico">
<INPUT name=your_name type=hidden value="Jagoper">
<input type=hidden name="browser_info" value="on">
<input type=hidden name="background_color" value="#ffffff">
<input type=hidden name="text_color" value="#000000">
<input type=hidden name="link_color" value="#0000ff">
<input type=hidden name="visited_link_color" value="#ff0066">
<input type=hidden name="active_link_color" value="#ffff00">
<INPUT TYPE="hidden" NAME="thank_you_title" VALUE="Gracias por tu mensaje">
<INPUT TYPE="hidden" NAME="return_link_url" VALUE="http://www.jagoper.com/principal.htm">
<INPUT TYPE="hidden" NAME="return_link_name" VALUE="Volver a la Pagina Principal">
<b>Tema:</b>
<INPUT TYPE="TEXT" name=email_subject_line SIZE="30"><BR>
<b>Mensaje:</b><BR>
<textarea cols="40" rows="15" name="mensaje">
</textarea><BR>
<b>Tu nombre:</b><br>
<input type=text name="visitor_name"><br>
<b>Tu email</b><BR>
<INPUT TYPE="TEXT" name="visitor_email_address" SIZE="30"><BR>
<b>Tu pagina (opcional)</b><BR>
<input type="text" name="visitor_web_page" value="http://" size="40" maxlength="80"><BR>
<input type="hidden" name="reply_warning" value="off">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="enviar">
<input type="Reset" value="borrar">
</FORM>
<!-- termina Response-O-Matic mensaje -->
FORMULARIO 2:
- Código:
<!-- comienza Response-O-Matic mensaje implementado según http://www.fagoco.com modifique con los datos de su email y su página y según su diseño (se recomienda encriptar el email). Pegar en BODY, más datos en www.response-o-matic.com -->
<FORM action=http://www.response-o-matic.com/cgi-bin/rom.pl method=post>
<INPUT name=your_email_address type=hidden value="suemail@poner.aqui">
<INPUT name=your_name type=hidden value="su_nombre">
<input type=hidden name="browser_info" value="on">
<input type=hidden name="background_color" value="#ffffff">
<input type=hidden name="text_color" value="#000000">
<input type=hidden name="link_color" value="#0000ff">
<input type=hidden name="visited_link_color" value="#ff0066">
<input type=hidden name="active_link_color" value="#ffff00">
<INPUT TYPE="hidden" NAME="thank_you_title" VALUE="Gracias por su mensaje - Thanks for your message">
<INPUT TYPE="hidden" NAME="return_link_url" VALUE="URL de retorno en forma http://www.dominio.com/pagina.html">
<INPUT TYPE="hidden" NAME="return_link_name" VALUE="Volver a la Página Principal - Main Page">
<b>Tema-Subject:</b>
<INPUT TYPE="TEXT" name=email_subject_line SIZE="30"><BR>
<b>Mensaje-Message:</b><BR>
<textarea cols="40" rows="15" name="mensaje">
</textarea><BR>
<b>su nombre (opcional):</b><br>
<input type=text name="visitor_name"><br>
<b>su email (opcional)-your email (optional)</b><BR>
<INPUT TYPE="TEXT" name="visitor_email_address" SIZE="30"><BR>
<b>su página (opcional)-your URL (optional)</b><BR>
<input type="text" name="visitor_web_page" value="http://" size="40" maxlength="80"><BR>
<input type="hidden" name="reply_warning" value="off">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="enviar-send">
<input type="Reset" value="borrar-clear">
</FORM>
<!-- termina Response-O-Matic mensaje -->
otro coleccion de codigos
FORMULARIO 3:
VENTANA DE AVISO:
SALUDO AL VISITANTE:
FONDO INTERMITENTE:
FONDO DE COHETES:
ENVIAR UN E-MAIL:
TEXTO QUE SIGUE AL RATON 2:
TEXTO LATIENDO
- Código:
<HTML>
<HEAD>
<TITLE>TextArea y Select</TITLE>
</HEAD>
<BODY>
<FORM METHOD="POST" ACTION="programa.cgi">
<P>¿Cuál es tu página Web Favorita?:
<BR><SELECT NAME="menu1">
<OPTION VALUE="primera">Edición Extremadamente Simple de HTML</OPTION>
<OPTION VALUE="segunda">Esta en la que estoy</OPTION>
<OPTION VALUE="tercera">La página de HTML de Fagoco</OPTION>
<OPTION VALUE="cuarta">Todas las anteriores son ciertas</OPTION>
</SELECT>
<p>¿Por qué te gusta? (Puedes dar varias razones):
<BR><SELECT NAME="menu2" SIZE="4" MULTIPLE>
<OPTION VALUE="primera" SELECTED>Porque sí</OPTION>
<OPTION VALUE="segunda">Porque me dá la gana</OPTION>
<OPTION VALUE="tercera">Porque es muy bonita</OPTION>
<OPTION VALUE="cuarta">¿Y a tí que te importa?</OPTION>
</SELECT>
<p>Incluye un comentario sobre ella:
<BR><TEXTAREA NAME="coment" ROWS="10" COLS="30">
Me parece que Joska1993 es un tipo estupendo,
y estoy dispuesto a dejarle mi herencia.
Me ha hecho una persona mejor y ahora me siento
muy feliz gracias a su tutorial.
Gracias Nikeandjoska1993.
</TEXTAREA>
<p><INPUT TYPE="SUBMIT" VALUE="Enviar"><INPUT TYPE="RESET" VALUE="Borrar">
</FORM>
</BODY>
</HTML>
VENTANA DE AVISO:
- Código:
<script language=Javascript> open('muestra.htm','muestra',"toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=490,height=232");</script>
SALUDO AL VISITANTE:
- Código:
<html>
<head><script LANGUAGE="Javascript">
<!--BEGIN script
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
var VisitorName = GetCookie('VisitorName')
if (VisitorName == null) {
VisitorName = prompt("como te llamas?");
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}
function When(info){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat.substring(0,3)
var dateMonth = lastHereInDateFormat.substring(4,11)
var timeOfDay = lastHereInDateFormat.substring(11,16)
var year = lastHereInDateFormat.substring(23,25)
var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay
SetCookie ("WWhenH", rightNow.getTime(), exp)
return WWHText
}
function Count(info){
var WWHCount = GetCookie('WWHCount')
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount', WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("como te llamas");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
document.location="http://www.terra.es/personal8/webtrucos";
}
function getCookieVal (offset) {
var endstr = document·cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document·cookie.length;
return unescape(document·cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document·cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document·cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document·cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document·cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document·cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
// End -->
</script>
<title>JavaFILE</title>
<base target="leftframe">
</head>
<body BGCOLOR="#ffffff" link="#CC0033" vlink="#333399" alink="#FF0000" <!--content start-->
<table WIDTH="96%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<tr>
<p align="center"><script LANGUAGE="Javascript">
document.write("Hola " + Who() + ". usted ha estado en esta pagina " + Count() + " veces. la zltima vez que nos visits fue " + When() +".");
</script>
</p>
</tr>
</table>
<!--content stop-->
</body>
</html>
FONDO INTERMITENTE:
- Código:
<script language="Javascript">
<!--
// Copyright 2001 by www.CodeBelly.com
// Por favor *NO* remover esta noticia.
var backColor = new Array(); // don't change this
// velocidad (in milliseconds).
var dwellTime = 500;
// Poner los colores que deseas usar. el ultimo
// backColor[4] sera el color definitivo de la
// pagina.
backColor[0] = '#FF0000';
backColor[1] = '#33ff33';
backColor[2] = '#3333ff';
backColor[3] = '#ffff00';
backColor[4] = '#FFFFFF';
function flashBG(whichColor){
document.bgColor = backColor[whichColor];
}
var t = null;
var d = dwellTime;
t = setTimeout('flashBG(0)',(d-d));
t = setTimeout('flashBG(1)',(d));
t = setTimeout('flashBG(2)',(d*2));
t = setTimeout('flashBG(3)',(d*3));
t = setTimeout('flashBG(4)',(d*4));
t = null;
//-->
</script>
FONDO DE COHETES:
- Código:
<script language="Javascript">
<!-- IE4+, NS4+, NS6 script Fuegos Artificiales por kurt.grigg@virgin.net
CL=new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','#ff00ff')
CL2=new Array('#ffa500','#00ff00','#FFAAFF','#fff000','#fffffF')
Xpos=130;
Ypos=130;
I='#00ff00';
C=0;
S=5;
H=null;
W=null;
Y=null;
NS4=(document.layers);
NS6=(document.getElementById&&!document.all);
IE4=(document.all);
A=14;
E=120;
L=null;
if (NS4){
for (i=0; i < A; i++)
document.write('<LAYER NAME="nsstars'+i+'" TOP=0 LEFT=0 BGCOLOR='+I+' CLIP="0,0,2,2"></LAYER>');
}
if (NS6){
window.document.body.style.overflow='hidden';
for (i=0; i < A; i++)
document.write('<div id="ns6stars'+i+'" style="position:absolute;top:0px;left:0px;height:2px;width:2px;font-size:2px;background:'+I+'"></div>');
}
if (IE4){
document.write('<div id="ie" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < A; i++)
document.write('<div id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:'+I+';font-size:2px"></div>');
document.write('</div></div>');
}
function Fireworks(){
H=(NS4||NS6)?window.innerHeight:window.document.body.clientHeight;
W=(NS4||NS6)?window.innerWidth:window.document.body.clientWidth;
Y=(NS4||NS6)?window.pageYOffset:window.document.body.scrollTop;
for (i=0; i < A; i++){
if (IE4)L=iestars[i].style;
if (NS4)L=document.layers["nsstars"+i];
if (NS6)L=document.getElementById("ns6stars"+i).style;
var F = CL[Math.floor(Math.random()*CL.length)];
var RS=Math.round(Math.random()*2);
L.top = Ypos + E*Math.sin((C+i*5)/3)*Math.sin(C/100)
L.left= Xpos + E*Math.cos((C+i*5)/3)*Math.sin(C/100)
if (C < 110){
if (NS4){L.bgColor=I;L.clip.width=1;L.clip.height=1}
if (IE4||document.getElementById)
{L.background=I;L.width=1;L.height=1;L.fontSize=1}
}
else{
if (NS4){L.bgColor=F;L.clip.width=RS;L.clip.height=RS}
if (IE4||document.getElementById){L.background=F;L.width=RS;L.height=RS;L.fontSize=RS}
}
}
if (C > 220){
C=0;
var NC = CL2[Math.floor(Math.random()*CL2.length)];
I=NC;
E=Math.round(100+Math.random()*90);
Ypos = E+Math.round(Math.random()*(H-(E*2.2)))+Y;
Xpos = E+Math.round(Math.random()*(W-(E*2.2)));
}
C+=S;
setTimeout("Fireworks()",10);
}
Fireworks();
// -->
ENVIAR UN E-MAIL:
- Código:
<a href="mailto:direccion@servidor.com?subject=Saludos de Jagoper.">Pulsa aqui para mandarme un e-mail</a>
TEXTO QUE SIGUE AL RATON 2:
- Código:
<html>
<head>
<style>
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:9pt;
font-family:Tahoma;
font-weight:bold;
color:blue;
}
</style>
<script>
var x,y
var step=20
var flag=0
// Tienes que dejar un espacio al final de tu mensaje!!!!!
var message="Tu mensaje va aqui... "
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",30)
}
</script>
</head>
<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll">
</body>
<script>
<!-- Beginning of Javascript -
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
// - End of Javascript - -->
</script>
</html>
TEXTO LATIENDO
- Código:
<span id="TexteBat" style="width:100%">
<h1>Your text</h1>
</span>
</center>
<script>
<!--
var from = 4;
var to = 12;
var delay = 55;
var glowColor = "#00FF00";
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script>
mas codigos para la coleccion
CALENDARIO MENSUAL
CARTEL CON LETRAS LUMINOSAS
Efecto terremoto
Quitar marcos
Efecto nieve
LOS USUARIOS DE TU WEB, RECOMIENDAN TU WEB.
- Código:
<script LANGUAGE="Javascript">
<!-- Mas scripts en [url=http://www.creatupropiaweb.com]http://www.creatupropiaweb.com[/url] -->
<!-- Begin
var now = new Date();
var month_array = new Array("january","february","march","April","May","June","July","August","September","October","November","December");
document.write("<form name=date_list><table bgcolor=silver><tr><td>");
document.write("<select name=month onchange=change_month(this.options.selectedIndex)>");
for(i=0;i<month_array.length;i++)
{
if (now.getMonth() != i)
{document.write ("<option value="+i+">"+month_array[i]);}
else
{document.write ("<option value="+i+" selected>"+month_array[i]);}
}
document.write("</select>");
document.write("</td><td>");
document.write ("<select name=year onchange=change_year(this.options[this.options.selectedIndex])>");
for(i=1950;i<3000;i++)
{
if (now.getYear() != i)
{document.write("<option value="+i+">"+i);}
else
{document.write("<option value="+i+" selected>"+i);}
}
document.write("</select></td></tr><tr><td colspan=2><center>");
document.write("<table bgcolor=white border=0 cellspacing = 0 cellpading = 0 width=100%><tr bgcolor=gray align=center>");
document.write("<td><font color=silver>M</font></td><td><font color=silver>T</td><td><font color=silver>W</td><td><font color=silver>T</td><td><font color=silver>F</td><td ><font color=silver>S</td><td ><font color=silver>S</td>");
document.write("</tr><tr>");
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
document.write("<td align=center id=d"+i+"r"+j+"></td>")
}
document.write("</tr>");
}
document.write("</table>");
document.write("</center></from></td></tr></table>");
var show_date = new Date();
function set_cal(show_date)
{
begin_day = new Date (show_date.getYear(),show_date.getMonth(),1);
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getYear(),show_date.getMonth()+1,1);
count_day = (end_day - begin_day)/1000/60/60/24;
input_table(begin_day_date,count_day);
}
set_cal(show_date);
function input_table(begin,count)
{
init();
j=0;
if (begin!=0){i=begin-1;}else{i=6}
for (c=1;c<count+1;c++)
{
colum_name = eval("d"+i+"r"+j);
if ((now.getDate() == c)&&(show_date.getMonth() == now.getMonth())&&(show_date.getYear() == now.getYear())) {colum_name.style.backgroundColor = "blue";colum_name.style.color = "white";};
colum_name.innerText = c;
i++;
if (i==7){i=0;j++;}
}
}
function init()
{
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
colum_name = eval("d"+i+"r"+j);
colum_name.innerText = "-";
colum_name.style.backgroundColor ="";
colum_name.style.color ="";
}
}
}
function change_month(sel_month)
{
show_date = new Date(show_date.getYear(),sel_month,1);
set_cal(show_date);
}
function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
// End -->
</script>
CARTEL CON LETRAS LUMINOSAS
- Código:
<span id="TexteBat" style="width:100%">
<h1><font color="#ffffff"> Aprende a<br>Crear tu web</font></h1>
</span>
</center>
<script>
<!-- Mas scripts en [url=http://www.nikeandjoska1993.es.tl]http://www.nikeandjoska1993.superforo.net[/url] -->
<!--
var from = 2;
var to = 12;
var delay = 55;
var glowColor = "#0000ff";
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script>
Efecto terremoto
- Código:
<html>
<head>
<title>Efecto 1</title>
</head>
<script LANGUAGE="Javascript1.2">
<!--
function sacudir_xy(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
function sacudir_x(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(i,0);
self.moveBy(-i,0);
}
}
}
}
function sacudir_y(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(0,-i);
}
}
}
}
//-->
</script>
<body>
<a href=" # " onMouseOver ="javascript:sacudir_ xy ( 20 )"> Sacudir la pantalla pantalla </a>
</body>
</html>
Quitar marcos
- Código:
<script language="Javascript">
function quitarFrame()
{
if (self.parent.frames.length != 0)
self.parent.location=document.location.href;
}
quitarFrame()
</script>
Efecto nieve
- Código:
<script language="Javascript1.2">
//Configura la URL de la imagen
var snowsrc="snow.gif"
//Selecciona cuantas imagenes quieres que aparezcan
var no = 10;
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;
if (ns4up||ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><a href="http://dynamicdrive.com/"><img src='"+snowsrc+"' border="0"></a></layer>");
} else {
document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><img src='"+snowsrc+"' border="0"></layer>");
}
} else if (ie4up||ns6up) {
if (i == 0) {
document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><a href="http://dynamicdrive.com"><img src='"+snowsrc+"' border="0"></a></div>");
} else {
document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><img src='"+snowsrc+"' border="0"></div>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", 10);
}
function snowIE_NS6() { // IE and NS6 main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = ns6up?window.innerWidth : document.body.clientWidth;
doc_height = ns6up?window.innerHeight : document.body.clientHeight;
}
dx[i] += stx[i];
if (ie4up){
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
else if (ns6up){
document.getElementById("dot"+i).style.top=yp[i];
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]);
}
}
setTimeout("snowIE_NS6()", 10);
}
if (ns4up) {
snowNS();
} else if (ie4up||ns6up) {
snowIE_NS6();
}
</script>
- Código:
var snowsrc="snow.gif"
LOS USUARIOS DE TU WEB, RECOMIENDAN TU WEB.
- Código:
<form name="eMailer">
ENVÍA ESTA PÁGINA A UN AMIGO
<br>
Indica su e-mail:
<br>
<input type="text" name="address" size="25">
<br>
<input type="button" value="Recomendá esta Web!" onClick="mailThisUrl();">
</form>
<script language="Javascript1.2">
var good;
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|
(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){
good = true
} else {
alert('Por favor introduce un e-mail valido')
field.focus()
field.select()
good = false
}
}
u = window.location;
m = "Pienso que te puede interesar esta página...";
function mailThisUrl(){
good = false
checkEmailAddress(document.eMailer.address)
if (good){
// the following expression must be all on one line...
window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u;
}
}
</script>
:: Tutoriales :: Tutoriales PWG
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.