Hi all ! I want to develop a text slideshow for welcome page of my website. i want to set interval of 10 secs between each slide, also i want to use dynamic text that must come from database in this text slideshow rather than just relying on static text. Please please help. It's urgent.
Hi Malik! I found this text slideshow very informative. In this text slideshow you can arrange slides by yourself, slides can come random and also it teachs how to get text from database and then show that text in the slides for this text slideshow. have a look over this Text slideshow in javascript
JavaScript slideshows are just client script; if you want to use dynamic text (from DB) you must use server script to make when had the some necessary dynamic text; you can use one of text JavaScripts from my site for slideshow effects on your web
as you want to fetch your texts from database. First you store all your text separated with some delimiter in one variable (the server side variable ASP,PHP,.NET) then you can have tht variable in your javascript, you can use the reference given by mrmaf. then you can split the value of that variable delimited by some character & have it in JS array & rest of the code you can use same as follows: <html> <head> <title>Text Slideshow in javascript</title> <script type="text/javascript" language="javascript"> var texts = "<%=variablename%>" ----- for ASP var texts = "<?=variablename?>" ----- for PHP var slideArray = split(texts, "yourdelimiter") function Slide() { for(i=0;i<slideArray.length;i++) document.getElementById('div_display').innerHTML=slideArray; setTimeout("secondSlide()",10000); } Slide() </script> </head> <body> <table width="100%" cellpadding="2" cellspacing="2"> <tr> <td> <div id="div_display"><script type="text/javascript" language="javascript">Slide();</script></div> </td> </tr> </table> </body> </html> I have modified the code. Please check for syntax. You can use the logic