Main Menu

SlideShow

Started by kazin, November 10, 2006, 06:34:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kazin

Bueno gente... aca les dejo un script para pasar imagenes de forma
"copada" (SlideShow)... si les gusta pueden ponerlos en sus webs ;).
El script puede ir en cualquier lado (osea.. ni head, ni body) pero asegurarse de que la IMG este en el body ;).
Bueno aca ta el script:

<script>
var slideShowSpeed = 5500
// Aca va la velocidad de Slide (milisegundos)


var crossFadeDuration = 3
// Duracion del efecto slide (segundos)


var Pic = new Array()
// NO TOCAR ESTO :P

Pic[0] = 'LaPrimera.jpg'
Pic[1] = 'LaSegunda.jpg'
Pic[2] = 'LaTercera.jpg'

// Para agregar mas imagenes simplemente agregar
// el numero de PIC.

// =======================================
// xD   No editen nada despues de aca   xD
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()     
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

// FUENTE = ¹SlowEmotion² HackPR Staff... ( http://hackpr.net/foro )

</script>


Bueno ahi termina el codigo... ahora para que arranque automaticamente
en el body de la web hay que poner...


<body bgcolor=black onload="runSlideShow()"> 
<img src="LaPrimera.jpg" name='SlideShow' width=465 height=240>


donde "LaPrimera.jpg" seria la primer imagen.. luego la acomodan cada
cual a su propio gusto ;)... bueno espero que les halla gustado este
script sencillo pero util !

*---------------*--------------------*-----------------*------------*

Tuto by.... ¹SlowEmotion²
Saludos a Deyabu, Anthrax, Th6, Misterius Fear, Komtec1, Uleila.com.

HackPr.Net r00lz.... http://hackpr.net/foro