j.garcia2 Admin
Cantidad de envíos : 742 Edad : 34 Localización : Madrid - España Puntos : 9 Reputación : 0 Fecha de inscripción : 04/06/2008
| Tema: 1er aporte códigos javascript Vie Jun 06, 2008 5:49 pm | |
| Bueno aquí os dejo el primer aporte de códigos javascript que los disfrutéis: Cursor: - Código:
-
<style> <!-- BODY{ CURSOR: url(NOMBRE DEL CURSOR); } --> </style> Texto con sombra en 3d: - Código:
-
<div id="sombra" style="position:relative;width:300;height:50r;filter:shadow(color=#00FFFF)"> <br> <font color=#CC0000 size=5>AQUI TU TEXTO<br></DIV><br>
</font></br>
Color de fondo: - Código:
-
<!-- www.todopcsymas.foroactivo.com.es --> <script LANGUAGE="Javascript"> <!-- function fondo(color) { document.bgColor = color } //--> </script> <IMG SRC="minilab.gif" WIDTH=297 HEIGHT=31 BORDER=0 ismap USEMAP="#colormap"> <MAP NAME="colormap"> <AREA COORDS="89,1,102,14" HREF="javascript:fondo('#FFFFFF')"> <AREA COORDS="104,1,117,14" HREF="javascript:fondo('#00FFFF')"> <AREA COORDS="119,1,132,14" HREF="javascript:fondo('#FF00FF')"> <AREA COORDS="134,1,147,14" HREF="javascript:fondo('#0000FF')"> <AREA COORDS="149,1,162,14" HREF="javascript:fondo('#FFFF00')"> <AREA COORDS="164,1,177,14" HREF="javascript:fondo('#00FF00')"> <AREA COORDS="179,1,192,14" HREF="javascript:fondo('#FF0000')"> <AREA COORDS="194,1,207,14" HREF="javascript:fondo('#808080')"> <AREA COORDS="89,16,102,29" HREF="javascript:fondo('#C0C0C0')"> <AREA COORDS="104,16,117,29" HREF="javascript:fondo('#008080')"> <AREA COORDS="119,16,132,29" HREF="javascript:fondo('#800080')"> <AREA COORDS="134,16,147,29" HREF="javascript:fondo('#000080')"> <AREA COORDS="149,16,162,29" HREF="javascript:fondo('#808000')"> <AREA COORDS="164,16,177,29" HREF="javascript:fondo('#008000')"> <AREA COORDS="179,16,192,29" HREF="javascript:fondo('#800000')"> <AREA COORDS="194,16,207,29" HREF="javascript:fondo('#000000')"> <AREA COORDS="209,0,296,30" HREF="http://www.creatupropiaweb.com"> </MAP><!-- www.todopcsymas.foroactivo.com.es --> Texto que aparece: - Código:
-
<script language="Javascript1.2">var delay=3000 //pausa (en milisegundos) var fcontent=new Array() begintag='<font face="Arial" size=2>' //tag que abre los mensajes fcontent[0]="<b></b><br><br>Crea tu propia pagina personal." fcontent[1]="Monta tu pagina con FrontPage Express , veras que es muy facil." fcontent[2]="En estas paginas encontraras los recursos y la manera de poder realizarlo de forma muy sencilla." closetag='</font>'
var fwidth=150 //ancho var fheight=150 //alto
///No editar/////////////////
var ie4=document.all&&!document.getElementById var ns4=document.layers var DOM2=document.getElementById var faderdelay=0 var index=0
if (DOM2) faderdelay=2000
//function to change content function changecontent(){ if (index>=fcontent.length) index=0 if (DOM2){ document.getElementById("fscroller").style.color="rgb(255,255,255)" document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag colorfade() } else if (ie4) document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag else if (ns4){ document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag) document.fscrollerns.document.fscrollerns_sub.document.close() }
index++ setTimeout("changecontent()",delay+faderdelay) }
// colorfade() partially by Marcio Galli for Netscape Communications. ////////////
frame=20; hex=255 // Initial color value.
function colorfade() { // 20 frames fading process if(frame>0) { hex-=10; // increase color value document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")";// Set color value. frame--; setTimeout("colorfade()",20); } else{ document.getElementById("fscroller").style.color="rgb(255,0,0)"; frame=20; hex=255 } }
if (ie4||DOM2) document.write('<div id="fscroller" style="border:1px solid ;width:'+fwidth+';height:'+fheight+';padding:2px"></div>')
window.onload=changecontent</script><ilayer id="fscrollerns" width=&{fwidth}; height=&{fheight};><layer id="fscrollerns_sub" width=&{fwidth}; height=&{fheight}; left=0 top=0></layer></ilayer> Rotador de imágenes: - Código:
-
<!-- Mas scripts en http://www.todopcsymas.foroactivo.com.es --> <script language="Javascript1.1"> var specifyimage=new Array() //Your images specifyimage[0]="boy4.gif" specifyimage[1]="boy5.gif" specifyimage[2]="boy6.gif"
var delay=3000 //3 seconds
//Counter for array var count =1;
var cubeimage=new Array() for (i=0;i<specifyimage.length;i++){ cubeimage[i]=new Image() cubeimage[i].src=specifyimage[i] }
function movecube(){ if (window.createPopup) cube.filters[0].apply() document.images.cube.src=cubeimage[count].src; if (window.createPopup) cube.filters[0].play() count++; if (count==cubeimage.length) count=0; setTimeout("movecube()",delay) }
window.onload=new Function("setTimeout('movecube()',delay)") </script>
<img src="boy4.gif" name="cube" border=0 style="filter:progid:DXImageTransform.Microsoft.Stretch(stretchStyle='PUSH')"> Botón de múltiples enlaces - Código:
-
<font face="Arial, Helvetica, sans-serif" size="2"> <script language="Javascript"> <!-- Mas scripts en http://www.todopcsymas.foroactivo.com.es --> var timerID = null var timerRunning = false var charNo = 0 var charMax = 0 var lineNo = 0 var lineMax = 3 var lineArr = new Array(lineMax) var urlArr = new Array(lineMax) lineArr[1] = "Crea tu propia WEB" urlArr[1] = "http://www.creatupropiaweb.com" lineArr[2] = "Los Codigos Web" urlArr[2] = "http://www.iespana.es/LosCodigosWeb/" lineArr[3] = "La web del Albañil" urlArr[3] = "http://es.geocities.com/juha_web/index.htm" var lineText = lineArr[1] function StartShow() { StopShow() ShowLine() timerRunning = true } function FillSpaces() { for (var i = 1; i <= lineWidth; i++) { spaces += " " } } function StopShow() { if (timerRunning) { clearTimeout(timerID) timerRunning = false } } function ShowLine() { if (charNo == 0) { if (lineNo < lineMax) { lineNo++ } else { lineNo = 1 } lineText = lineArr[lineNo] charMax = lineText.length } if (charNo <= charMax) { document.formDisplay.buttonFace.value = lineText.substring(0, charNo) charNo++ timerID = setTimeout("ShowLine()", 100) } else { charNo = 0 timerID = setTimeout("ShowLine()", 3000) } } function GotoUrl(url) { top.location.href = url } document.write("<form name=\"formDisplay\">"); document.write("<input type=\"button\" name=\"buttonFace\" value=\"&{lineText}\" size=\"18\" onClick=\"GotoUrl(urlArr[lineNo])\">"); document.write("</form>"); StartShow(); </script></font> Menú de enlaces con marco - Código:
-
<head> <style> .menulines{ border:1px solid white; }
.menulines a{ text-decoration:none; color:black; } </style>
<script language="Javascript1.2">
/* Highlight menu effect script: By Dynamicdrive.com For full source, Terms of service, and 100s DTHML scripts Visit http://www.dynamicdrive.com */
function borderize(what,color){ what.style.borderColor=color }
function borderize_on(e){ if (document.all) source3=event.srcElement else if (document.getElementById) source3=e.target if (source3.className=="menulines"){ borderize(source3,"black") } else{ while(source3.tagName!="TABLE"){ source3=document.getElementById? source3.parentNode : source3.parentElement if (source3.className=="menulines") borderize(source3,"black") } } }
function borderize_off(e){ if (document.all) source4=event.srcElement else if (document.getElementById) source4=e.target if (source4.className=="menulines") borderize(source4,"white") else{ while(source4.tagName!="TABLE"){ source4=document.getElementById? source4.parentNode : source4.parentElement if (source4.className=="menulines") borderize(source4,"white") } } }
</script> </head> | |
|