Scripts

9

Click here to load reader

Transcript of Scripts

Page 1: Scripts

.................... anular click derecho -...........................<scriptlanguage="JavaScript1.1"><!-- Beginfunction derecho(e) {if (navigator.appName == 'Netscape' &&(e.which == 2 || e.which == 3))return false;else if (navigator.appName == 'Microsoft Internet Explorer' &&(event.button == 3 || event.button == 2)) {alert("Boton Derecho Anulado...");return false;}return true;}document.onmousedown=derecho;if (document.layers) window.captureEvents(Event.MOUSEDOWN);window.onmousedown=derecho;// End --></script> ...........................................cambiar imagenes....................................................<!-- Dentro del tag HEAD -->

<script LANGUAGE="JavaScript"><!-- Comienzavar mfBanners = [['http://www.banner1-url-here.com', 'ban1.gif'], ['http://www.banner2-url-here.com', 'ban2.gif']];var mfIe = false;if( document.all) {mfIe = true;}var mfBannerIndex = 0;function mfBannerChange() {var htmlString = '<a target="_blank" href="'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src="'+mfBanners[mfBannerIndex][1]+'"></a>';if( mfIe) {document.all.banner.innerHTML = htmlString;}else {document.layers["banner"].document.open();document.layers["banner"].document.write( htmlString);document.layers["banner"].document.close();}if(mfBannerIndex < mfBanners.length - 1)mfBannerIndex++;elsemfBannerIndex = 0;}setInterval("mfBannerChange()", 3000);// End --></script>

<!-- Dentro del tag BODY -->

<div id="banner"></div>

Page 2: Scripts

..........................................................scrollde noticias.....

.............................................................................<!-- Copiar este código dentro del tag BODY -->

<script language="JavaScript1.2">

// anchovar marqueewidth=150// altovar marqueeheight=80// velocidadvar speed=1// contenidovar marqueecontents='<font face="Arial"><small>Hecho de forma gratuita para ayudar a todos los guebmasters.<p> </p>Si necesitas un toque de dinamismo mayor para tu web visita http://www.publispain.com/webmaster/.</small></a></font>'

if (document.all)document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')

function regenerate(){window.location.reload()}function regenerate2(){if (document.layers){setTimeout("window.onresize=regenerate",450)intializemarquee()}}

function intializemarquee(){document.cmarquee01.document.cmarquee02.document.write(marqueecontents)document.cmarquee01.document.cmarquee02.document.close()thelength=document.cmarquee01.document.cmarquee02.document.heightscrollit()}

function scrollit(){if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){document.cmarquee01.document.cmarquee02.top-=speedsetTimeout("scrollit()",100)}else{document.cmarquee01.document.cmarquee02.top=marqueeheightscrollit()}}

window.onload=regenerate2</script>---------------------------moviendo ventanas ----------------------------------------------------------

<!-- PRIMER PASO: Colocar este javascript en la página mover01.htm -->

<SCRIPT LANGUAGE="JavaScript"><!--

function makeAd() {

Page 3: Scripts

window.open("mover02.htm", "Mover", "width=468,innerWidth=468,height=80,innerHeight=80,left=0,top=0");}

// --></SCRIPT>

<!-- SEGUNDO PASO: Colocar el botón que activa la ventan en la página mover01.htm -->

<form> <p><input TYPE="button" VALUE="Mover Ventana" onClick="makeAd()"></p></form>

<!-- TERCER PASO: Colocar este javascript en la página mover02.htm -->

<script LANGUAGE="JavaScript"><!--

function startAd() { if (window.screen) { pos = 0; aw = screen.availWidth; window.moveTo(pos, 0); timerID = setInterval("moveAd()", 50); }}

function moveAd() { if (pos <= 0) inc = 5; if (pos + 468 + 10 + 5 > aw) inc = -5; pos += inc; window.moveTo(pos, 0);}

window.onload = startAd;

// --></script>

-------------------------------------------------mensaje de bienvenida--------------------------------------------------------------<!-- PRIMER PASO: Copiar dentro del tag HEAD -->

<style type="text/css">

#supertext {position:absolute;left:0;top:0;visibility:hide;visibility:hidden;

}

</style>

<!-- SEGUNDO PASO: Copiar dentro del tag BODY -->

<script language="JavaScript1.2">

Page 4: Scripts

// Script Original: Lloyd Hassell's

// Mensajevar thecontent='<h2><font color="#0000FF">Sólo Códigos Javascript!!</font></h2>'// Tiempo de animación en milisegundos ('' = infinito)var hidetimer=7000;// Velocidadvar BallSpeed = 10;

var contentWidth;var contentHeight;var maxBallSpeed = 50;

var xMax;var yMax;var xPos = 0;var yPos = 0;var xDir = 'right';var yDir = 'down';var superballRunning = true;var tempBallSpeed;var currentBallSrc;var newXDir;var newYDir;

function initializeBall() { if (document.all) { xMax = document.body.clientWidth yMax = document.body.clientHeight document.all("supertext").style.visibility = "visible"; contentWidth=supertext.offsetWidth contentHeight=supertext.offsetHeight } else if (document.layers) { xMax = window.innerWidth; yMax = window.innerHeight; contentWidth=document.supertext.document.width contentHeight=document.supertext.document.height document.layers["supertext"].visibility = "show"; } setTimeout('moveBall()',400); if (hidetimer!='') setTimeout("hidetext()",hidetimer) }

function moveBall() { if (superballRunning == true) { calculatePosition(); if (document.all) { document.all("supertext").style.left = xPos + document.body.scrollLeft; document.all("supertext").style.top = yPos + document.body.scrollTop; } else if (document.layers) { document.layers["supertext"].left = xPos + pageXOffset; document.layers["supertext"].top = yPos + pageYOffset; } animatetext=setTimeout('moveBall()',20);

Page 5: Scripts

} }

function calculatePosition() { if (xDir == "right") { if (xPos > (xMax - contentWidth - BallSpeed)) { xDir = "left"; } } else if (xDir == "left") { if (xPos < (0 + BallSpeed)) { xDir = "right"; } } if (yDir == "down") { if (yPos > (yMax - contentHeight - BallSpeed)) { yDir = "up"; } } else if (yDir == "up") { if (yPos < (0 + BallSpeed)) { yDir = "down"; } } if (xDir == "right") { xPos = xPos + BallSpeed; } else if (xDir == "left") { xPos = xPos - BallSpeed; } else { xPos = xPos; } if (yDir == "down") { yPos = yPos + BallSpeed; } else if (yDir == "up") { yPos = yPos - BallSpeed; } else { yPos = yPos; } }

function hidetext(){if (document.all)supertext.style.visibility="hidden"else if (document.layers)document.supertext.visibility="hide"clearTimeout(animatetext)}

if (document.all||document.layers){document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')window.onload = initializeBall;window.onresize = new Function("window.location.reload()");}

</script>-------------------------------ventana pop up ----------------------------------

Page 6: Scripts

-------------------------------------<!-- Copiar dentro del tag BODY -->

<script language="JavaScript"><!-- var ancho=100var alto=100var fin=300var x=100var y=100

function inicio(){

ventana = window.open("hola.htm", "_blank", "resizable,height=1,width=1,top=x,left=y,screenX=x,screenY=y");

abre();}function abre(){

if (ancho<=fin) {ventana.moveTo(x,y);ventana.resizeTo(ancho,alto);x+=5y+=5ancho+=15alto+=15timer= setTimeout("abre()",1)

}else {

clearTimeout(timer)}

}// --></script>

<form><input type="button" value="Abrir Ventana" onClick="inicio()"></p></form>-----------------------------------------------texto movimiento explorador---------body-------------------------------------------<Mas scripts en www.creatupropiaweb.com><SCRIPT LANGUAGE="JavaScript">var txt=" :-) www.creatupropiaweb.com ;-) - PARA CREAR TU WEB O MEJORARLA";var espera=100;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>.....................................................textos scroll .........................................body.........................................<mas scripts en www.creatupropiaweb.com><script language="JavaScript1.2">var scroller_width=200var scroller_height=120var bgcolor='#E0EFD1'var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)

var scrollercontent=new Array()

Page 7: Scripts

//Define scroller contents. Extend or contract array as neededscrollercontent[0]='Esto te puede servir para plasmar tus noticias , o tus novedades yo que se lo que se te pueda ocurrir.'scrollercontent[1]='Que no te a quedado claro , no me lo hagas repetir .'scrollercontent[2]='Visita mi pagina <a href="http://www.creatupropiaweb.com">creatupropiaweb</a><br>con un click aqui <a href="http://www.creatupropiaweb.com"> venga</a>'

////NO need to edit beyond here/////////////

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||dom)document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')else if (document.layers){document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')}

var curpos=scroller_height*(1)var degree=10var curcanvas="canvas0"var curindex=0var nextindex=1

function moveslide(){if (curpos>0){curpos=Math.max(curpos-degree,0)tempobj.style.top=curpos}else{clearInterval(dropslide)if (crossobj.filters)crossobj.filters.alpha.opacity=100else if (crossobj.style.MozOpacity)crossobj.style.MozOpacity=1nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)tempobj.innerHTML=scrollercontent[curindex]nextindex=(nextindex<scrollercontent.length-1)? nextindex+1 : 0setTimeout("rotateslide()",pause)}}

function rotateslide(){if (ie4||dom){resetit(curcanvas)crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)crossobj.style.zIndex++

Page 8: Scripts

if (crossobj.filters)document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20else if (crossobj.style.MozOpacity)document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2var temp='setInterval("moveslide()",50)'dropslide=eval(temp)curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"}else if (document.layers){crossobj.document.write(scrollercontent[curindex])crossobj.document.close()}curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0}

function resetit(what){curpos=scroller_height*(1)var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)crossobj.style.top=curpos}

function startit(){crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssubif (ie4||dom){crossobj.innerHTML=scrollercontent[curindex]rotateslide()}else{document.tickernsmain.visibility='show'curindex++setInterval("rotateslide()",pause)}}

if (ie4||dom||document.layers)window.onload=startit

</script></p></center>

-----------------------------------head barra de staDSO ANIMADO---------------------------------------------------<SCRIPT><!-- Mas trucos en www.creatupropiawebweb.com -->//change the title text below to your own var titletext="AQUI EL TEXTO QUE QUIERAS" var thetext="" var started=false var step=0 var times=1

function welcometext() { times--

Page 9: Scripts

if (times==0) { if (started==false) { started = true; document.title = titletext; setTimeout("anim()",1); } thetext = titletext; } }

function showstatustext(txt) { thetext = txt; setTimeout("welcometext()",4000) times++ }

function anim() { step++ if (step==7) {step=1} if (step==1) {document.title='>==='+thetext+'===<'} if (step==2) {document.title='=>=='+thetext+'==<='} if (step==3) {document.title='>=>='+thetext+'=<=<'} if (step==4) {document.title='=>=>'+thetext+'<=<='} if (step==5) {document.title='==>='+thetext+'=<=='} if (step==6) {document.title='===>'+thetext+'<==='} setTimeout("anim()",200); }

if (document.title)window.onload=onload=welcometext</SCRIPT>

------------------http://www.comocrearmiweb.com/2013/03/botones-con-css.html