Kódja
<SCRIPT language=JavaScript1.2>
/*********************************************** * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['http://www.net-cafe.hu/wallpapers/00000012.jpg', '', ''] variableslide[1]=['http://www.net-cafe.hu/wallpapers/00000015.jpg', '', ''] variableslide[2]=['http://www.net-cafe.hu/wallpapers/00000013.jpg', '', ''] //configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='130px' //set to width of LARGEST image in your slideshow var slideheight='100px' //set to height of LARGEST iamge in your slideshow, plus any text description var slidebgcolor='#F3F3F3'
//configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=3000
////Do not edit pass this line////////////////
var ie=document.all var dom=document.getElementById
for (i=0;i<variableslide.length;i++){ var cacheimage=new Image() cacheimage.src=variableslide[i][0] }
var currentslide=0
function rotateimages(){ contentcontainer='<center>' if (variableslide[currentslide][1]!="") contentcontainer+='<a href="'+variableslide[currentslide][1]+'">' contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">' if (variableslide[currentslide][1]!="") contentcontainer+='</a>' contentcontainer+='</center>' if (variableslide[currentslide][2]!="") contentcontainer+=variableslide[currentslide][2]
if (document.layers){ crossrotateobj.document.write(contentcontainer) crossrotateobj.document.close() } else if (ie||dom) crossrotateobj.innerHTML=contentcontainer if (currentslide==variableslide.length-1) currentslide=0 else currentslide++ setTimeout("rotateimages()",slidedelay) }
if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){ crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub if (document.layers) document.slidensmain.visibility="show" rotateimages() }
if (ie||dom) start_slider() else if (document.layers) window.onload=start_slider
</SCRIPT>
Piros színnel jeleztem a kép URL-címét.Azt cseréld le a saját képedre! Sötétkékkel jeleztem azt a rész,amit ha megduplázól, akkor immáron már 4 kép fogja egymást váltani. Ha mégeszer megduplázod akkor már 5 kép váltja egymást.Ügye érted? A zőld rész,a sorszám,nagyon fontos,hogy ha 4 képet akarsz megjeleníteni, akkor a sorszámát is írd át 4-re,ha már 5 képet teszel bele,akkor értelemszerűen a sorszám is eggyel nő!!! (tehát mikor duplázod a sötétkék részt,ne csak a kép linkjét cseréld le, hanem a sorszámot is növeld!!!) Ha azt akarod,hogy a kép a modulod közepére kerűljön, nincs más dolgod,mint az legeslegelejére, berod azt,hogy <center>, a legeslegvégére pedig azt,hogy </center>.Vili?
Ha készvagy,és ismét belépsz a szerkesztésébe, és ismét leokézod a modúlt,a kép megduplázódik, ezt úgy tudod kivédeni,hogy ha a szerkesztésébe lépsz, törlöd a végén "önmagától"beíródó HTML-kódot. Ide bemásolom azt, hogy mikor újra belépsz a szerkesztésbe, mit kell törőlnöd,hogy a kép ne duplázódjon meg (vagy ügye nem mászkálsz a szerkesztésébe.) Nos itt lenne,olyankor a piros rész TÖRLENDŐ(a végén van!)- -amiatt duplázódik a kép!!!
<SCRIPT language=JavaScript1.2>
/*********************************************** * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['http://www.net-cafe.hu/wallpapers/00000012.jpg', '', ''] variableslide[1]=['http://www.net-cafe.hu/wallpapers/00000015.jpg', '', ''] variableslide[2]=['http://www.net-cafe.hu/wallpapers/00000013.jpg', '', ''] //configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='130px' //set to width of LARGEST image in your slideshow var slideheight='100px' //set to height of LARGEST iamge in your slideshow, plus any text description var slidebgcolor='#F3F3F3'
//configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=3000
////Do not edit pass this line////////////////
var ie=document.all var dom=document.getElementById
for (i=0;i<variableslide.length;i++){ var cacheimage=new Image() cacheimage.src=variableslide[i][0] }
var currentslide=0
function rotateimages(){ contentcontainer='<center>' if (variableslide[currentslide][1]!="") contentcontainer+='<a href="'+variableslide[currentslide][1]+'">' contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">' if (variableslide[currentslide][1]!="") contentcontainer+='</a>' contentcontainer+='</center>' if (variableslide[currentslide][2]!="") contentcontainer+=variableslide[currentslide][2]
if (document.layers){ crossrotateobj.document.write(contentcontainer) crossrotateobj.document.close() } else if (ie||dom) crossrotateobj.innerHTML=contentcontainer if (currentslide==variableslide.length-1) currentslide=0 else currentslide++ setTimeout("rotateimages()",slidedelay) }
if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){ crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub if (document.layers) document.slidensmain.visibility="show" rotateimages() }
if (ie||dom) start_slider() else if (document.layers) window.onload=start_slider
</SCRIPT>
<DIV id=slidedom style="WIDTH: 130px; HEIGHT: 100px; BACKGROUND-COLOR: #f3f3f3"> <CENTER><IMG src="http://www.net-cafe.hu/wallpapers/00000013.jpg" vspace=3 border=0></CENTER></DIV>
Hogy mindenképp világosan láss,idemásolom milyen az a kód,amikor 4 kép váltja egymást, így szemléltetve azt,hogy melyik az a rész, amin változtatnod kell,ha 4 képet akarsz váltogatva megjeleníteni:
<SCRIPT language=JavaScript1.2>
/*********************************************** * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['http://www.net-cafe.hu/wallpapers/00000012.jpg', '', ''] variableslide[1]=['http://www.net-cafe.hu/wallpapers/00000015.jpg', '', ''] variableslide[2]=['http://www.net-cafe.hu/wallpapers/00000013.jpg', '', ''] variableslide[3]=['http://www.net-cafe.hu/wallpapers/00000010.jpg', '', '']
//configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='130px' //set to width of LARGEST image in your slideshow var slideheight='100px' //set to height of LARGEST iamge in your slideshow, plus any text description var slidebgcolor='#F3F3F3'
//configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=3000
////Do not edit pass this line////////////////
var ie=document.all var dom=document.getElementById
for (i=0;i<variableslide.length;i++){ var cacheimage=new Image() cacheimage.src=variableslide[i][0] }
var currentslide=0
function rotateimages(){ contentcontainer='<center>' if (variableslide[currentslide][1]!="") contentcontainer+='<a href="'+variableslide[currentslide][1]+'">' contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">' if (variableslide[currentslide][1]!="") contentcontainer+='</a>' contentcontainer+='</center>' if (variableslide[currentslide][2]!="") contentcontainer+=variableslide[currentslide][2]
if (document.layers){ crossrotateobj.document.write(contentcontainer) crossrotateobj.document.close() } else if (ie||dom) crossrotateobj.innerHTML=contentcontainer if (currentslide==variableslide.length-1) currentslide=0 else currentslide++ setTimeout("rotateimages()",slidedelay) }
if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){ crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub if (document.layers) document.slidensmain.visibility="show" rotateimages() }
if (ie||dom) start_slider() else if (document.layers) window.onload=start_slider
</SCRIPT>
--------------------------------- És itt mikor már 5 kép váltja egymást!:
<SCRIPT language=JavaScript1.2>
/*********************************************** * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['http://www.net-cafe.hu/wallpapers/00000012.jpg', '', ''] variableslide[1]=['http://www.net-cafe.hu/wallpapers/00000015.jpg', '', ''] variableslide[2]=['http://www.net-cafe.hu/wallpapers/00000013.jpg', '', ''] variableslide[3]=['http://www.net-cafe.hu/wallpapers/00000011.jpg', '', ''] variableslide[4]=['http://www.net-cafe.hu/wallpapers/00000014.jpg', '', '']
//configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='130px' //set to width of LARGEST image in your slideshow var slideheight='100px' //set to height of LARGEST iamge in your slideshow, plus any text description var slidebgcolor='#F3F3F3'
//configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=3000
////Do not edit pass this line////////////////
var ie=document.all var dom=document.getElementById
for (i=0;i<variableslide.length;i++){ var cacheimage=new Image() cacheimage.src=variableslide[i][0] }
var currentslide=0
function rotateimages(){ contentcontainer='<center>' if (variableslide[currentslide][1]!="") contentcontainer+='<a href="'+variableslide[currentslide][1]+'">' contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">' if (variableslide[currentslide][1]!="") contentcontainer+='</a>' contentcontainer+='</center>' if (variableslide[currentslide][2]!="") contentcontainer+=variableslide[currentslide][2]
if (document.layers){ crossrotateobj.document.write(contentcontainer) crossrotateobj.document.close() } else if (ie||dom) crossrotateobj.innerHTML=contentcontainer if (currentslide==variableslide.length-1) currentslide=0 else currentslide++ setTimeout("rotateimages()",slidedelay) }
if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){ crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub if (document.layers) document.slidensmain.visibility="show" rotateimages() }
if (ie||dom) start_slider() else if (document.layers) window.onload=start_slider
</SCRIPT>
|