otuatail Posted March 9, 2010 Share Posted March 9, 2010 Can anyone tell me how this is done. at the very bottom of the web page is rotating text. It seems to have a class <div id="news-headline"> http://www.premier.org.uk/radio TIA Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/ Share on other sites More sharing options...
Adam Posted March 9, 2010 Share Posted March 9, 2010 ...Rotating text? I don't see any. Do you mean the slider type thing? Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/#findComment-1023589 Share on other sites More sharing options...
otuatail Posted March 17, 2010 Author Share Posted March 17, 2010 yes it is sloly completing by sliding across. Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/#findComment-1027600 Share on other sites More sharing options...
Orionsbelter Posted March 18, 2010 Share Posted March 18, 2010 I think it's called something like auto typing text you may find it at dynamicdrive.com Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/#findComment-1028024 Share on other sites More sharing options...
Orionsbelter Posted March 18, 2010 Share Posted March 18, 2010 Looking at the code it seems to be this: // Convert news headlines into a news ticker var newsHeadlines = [], newsLinks = [], newsRun = true, newsPosition = 0, newsTimeout = -1, newsCurrent = 0, newsDelayStart = 1500, newsDelayLetter = 50, newsDelayNext = 3000, newsSource = "news-headline", newsOutput = "news-headline-box", newsElemAdd = "p", newsDivId = "newsTicker"; // Clear any timeout function newsClear() { if (newsTimeout != -1) { clearTimeout(newsTimeout); newsTimeout = -1; } } // Displays newsPosition characters of headline with index newsCurrent function newsProcess() { if ((!newsRun) || newsHeadlines.length < 1) { return false; } newsClear(); // Saving CPU but not rewriting a, title every time var writeFunc = newsPosition == 0 ? newsWrite : newsUpdate; writeFunc(newsHeadlines[newsCurrent].substr(0, newsPosition + 1), newsLinks[newsCurrent]); var curHead = newsHeadlines[newsCurrent]; if (newsPosition >= (newsHeadlines[newsCurrent].length - 1)) { newsTimeout = setTimeout(newsNext, newsDelayNext); } else { ++newsPosition; newsTimeout = setTimeout(newsProcess, newsDelayLetter); } } // Progress to the next headline function newsNext() { newsPosition = 0; newsCurrent = (newsCurrent + 1) % newsHeadlines.length; newsProcess(); } BY THE WAY THIS IS NOT MINE NOR YOUR CODE IF YOU CHOOSE TO USE IT YOU DO SO ON YOUR OWN RESPONSIBILITY. ALSO I HAVE NOT TESTED THIS CODE SO IT MAY NOT WORK Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/#findComment-1028026 Share on other sites More sharing options...
Orionsbelter Posted March 18, 2010 Share Posted March 18, 2010 I think it's actually called text ticker Quote Link to comment https://forums.phpfreaks.com/topic/194626-rotating-text/#findComment-1028028 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.