refresh pe banner la 10 sec
Ultima postare: iun 21 2005 15:33, Inițiat de
White
, iun 17 2005 18:51
·
0
#3
Publicat: 18 iunie 2005 - 10:45
#5
Publicat: 20 iunie 2005 - 14:39
de asta aveam nevoie .. http://www.codelifte...slideshow2.html
este super ok .. fata de ce trebuia sa fac .. thx White |
#8
Publicat: 20 iunie 2005 - 17:53
Intrebare ..
Scriptu arata cum il vedeti mai jos .. si imi afiseaza, le ia rand .. e ok .. acum .. eu vreau sa pun 6 div-uri .. ideea e ca imi afiseaza decat 1 .. si e normal (aceiasi functie).. cum ar trebui sa procedez sa le afisez ? Sa stau sa fac 6 functii diferite .. nu e ok .. vreau o alta metoada .. ceva mai practic <script type="text/javascript"> // Flexible Image Slideshow- By JavascriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit Javascript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use var ultimateshow=new Array() //ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"] <? include("OpenDB.php"); $query = "SELECT * FROM adv ORDER BY RAND() LIMIT 12"; $pResult = mysql_db_query( $dbname, $query ); $row = mysql_num_rows( $pResult ); for( $i = 0; $i < $row; $i++ ){ $array = mysql_fetch_row( $pResult ); //echo $array[1]; ?> ultimateshow[<?=$i?>]=["<?=$array[1]?>", '<?=$array[2]?>', '_new'] <? } include("CloseDB.php"); ?> //configure the below 3 variables to set the dimension/background color of the slideshow var slidewidth="40px" //set to width of LARGEST image in your slideshow var slideheight="50px" //set to height of LARGEST iamge in your slideshow var slidecycles="continous" //number of cycles before slideshow stops (ie: "2" or "continous") var randomorder="yes" //randomize the order in which images are displayed? "yes" or "no" var preloadimages="yes" //preload images? "yes" or "no" var slidebgcolor='none' //configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=1000 ////Do not edit pass this line//////////////// var ie=document.all var dom=document.getElementById var curcycle=0 if (preloadimages=="yes"){ for (i=0;i<ultimateshow.length;i++){ var cacheimage=new Image() cacheimage.src=ultimateshow[i][0] } } var currentslide=0 function randomize(targetarray){ ultimateshowCopy=new Array() var the_one var z=0 while (z<targetarray.length){ the_one=Math.floor(Math.random()*targetarray.length) if (targetarray[the_one]!="_selected!"){ ultimateshowCopy[z]=targetarray[the_one] targetarray[the_one]="_selected!" z++ } } } if (randomorder=="yes") randomize(ultimateshow) else ultimateshowCopy=ultimateshow function rotateimages(){ curcycle=(currentslide==0)? curcycle+1 : curcycle ultcontainer='<center>' if (ultimateshowCopy[currentslide][1]!="") ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'" target="'+ultimateshowCopy[currentslide][2]+'">' ultcontainer+='<img src="'+ultimateshowCopy[currentslide][0]+'" border="0">' if (ultimateshowCopy[currentslide][1]!="") ultcontainer+='</a>' ultcontainer+='</center>' if (ie||dom) crossrotateobj.innerHTML=ultcontainer if (currentslide==ultimateshow.length-1) currentslide=0 else currentslide++ if (curcycle==parseInt(slidecycles) && currentslide==0) return 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") : document.all.slidedom rotateimages() } if (ie||dom) window.onload=start_slider </script> thx White |
Anunturi
Bun venit pe Forumul Softpedia!
▶ Utilizatori activi: 1
0 membri, 1 vizitatori, 0 utilizatori anonimi