jwk811 Posted January 21, 2007 Share Posted January 21, 2007 how can i make a billboard so i can make a paragraph switch between different text like 10 times? i dont know if this is php or not.. thanks for your help! Quote Link to comment Share on other sites More sharing options...
trq Posted January 21, 2007 Share Posted January 21, 2007 You'll need to be alot clearer in the description of exactly what it is you want to do. Quote Link to comment Share on other sites More sharing options...
inztinkt Posted January 21, 2007 Share Posted January 21, 2007 thorpe he is looking for a text rotator.jwk811 what you are looking for is a combination of JavaScript, possible mixed with PHP and if done dynamically without refreshing the rest of the page, what it is referred to is AJAX (Asynchronous JavaScript and XML).now what you need to decide is the next step, are the paragraphs you want to rotate, going to be all loaded when the page opens or do you want to load a different paragraph every few seconds? Quote Link to comment Share on other sites More sharing options...
jwk811 Posted January 21, 2007 Author Share Posted January 21, 2007 yes i want it to change like every 5 or 10 seconds without having to reload the page... so i need to figure out how with ajax? i dont know how to use ajax.. ill read up about it on w3schools.. would you know how i could do this though? Quote Link to comment Share on other sites More sharing options...
inztinkt Posted January 21, 2007 Share Posted January 21, 2007 Article : http://www.sitepoint.com/article/rotate-content-with-dhtmlCode : http://www.dynamicdrive.com/dynamicindex2/prohtmlticker.htm Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 21, 2007 Share Posted January 21, 2007 A working example:[code]<html><head><script>var ratateSeconds = 10;paragraphs = new Array();paragraphs[0] = "Paragraph One";paragraphs[1] = "Paragraph Two";paragraphs[2] = "Paragraph Three";paragraphs[3] = "Paragraph Four";paragraphs[4] = "Paragraph Five";paragraphs[5] = "Paragraph Six";paragraphs[6] = "Paragraph Seven";paragraphs[7] = "Paragraph Eight";paragraphs[8] = "Paragraph Nine";paragraphs[9] = "Paragraph Ten";var paraIndex = 0;function rotatePara() { document.getElementById('paraDiv').innerHTML = paragraphs[paraIndex]; paraIndex++ if (paraIndex>=paragraphs.length) { paraIndex=0; } setTimeout('rotatePara()', ratateSeconds*1000)}</script></head><body onLoad="rotatePara();"><div id="paraDiv"></div></body></html>[/code] Quote Link to comment Share on other sites More sharing options...
jwk811 Posted January 21, 2007 Author Share Posted January 21, 2007 awesome! thanks alot that worked! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.