peasepud 59 Posted September 13, 2005 Share Posted September 13, 2005 Anyone got a good one? I've written one buts its not much cop as I cant seem to hide the textbox it just stays white with a border, searched the net and cant seem to get any good ones I find incorporated into the page for some reason. Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 13, 2005 Share Posted September 13, 2005 what about the one on the bbc news site?? Link to comment Share on other sites More sharing options...
peasepud 59 Posted September 13, 2005 Author Share Posted September 13, 2005 what about the one on the bbc news site?? 32487[/snapback] Dont think its Javascript. had a quick neb and viewed the .js files but cant seem to find mention of a ticker tape script. Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 13, 2005 Share Posted September 13, 2005 this appears to be the script they're using.... <script language="JavaScript" type="text/javascript"> <!-- function createClass() { if ((document.getElementById) && (document.body.innerHTML)) { document.write("<div class='ticko'>"); } else { document.write("<div class='tickh'>"); } } createClass(); // --> </script><iframe height="13" marginwidth="0" width="629" scrolling="no" src="/nol/ukfs_news/hi/front_page/ticker.stm" frameborder="0" marginheight="0"></iframe></div> See if you can decipher that - i'll have a look in the morning at it when i'm more awake... Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 13, 2005 Share Posted September 13, 2005 This is the html of the page which holds the ticker itself: <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <link type="text/css" rel="stylesheet" href="/nol/shared/css/news.css" /> </head> <body> <div class="ticki"><a id="tickerAnchor" href="#" target="_top" class="tickl"></a></div> <script language="JavaScript" type="text/javascript"> <!-- // Ticker startup function startTicker() { // Define run time values theCurrentStory = -1; theCurrentLength = 0; // Locate base objects if (document.getElementById) { theAnchorObject = document.getElementById("tickerAnchor"); runTheTicker(); } else { document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>"); return true; } } // Ticker main run loop function runTheTicker() { var myTimeout; // Go for the next story data block if(theCurrentLength == 0) { theCurrentStory++; theCurrentStory = theCurrentStory % theItemCount; theStorySummary = theSummaries[theCurrentStory].replace(/"/g,'"'); theTargetLink = theSiteLinks[theCurrentStory]; theAnchorObject.href = theTargetLink; thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>"; } // Stuff the current ticker text into the anchor theAnchorObject.innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget(); // Modify the length for the substring and define the timer if(theCurrentLength != theStorySummary.length) { theCurrentLength++; myTimeout = theCharacterTimeout; } else { theCurrentLength = 0; myTimeout = theStoryTimeout; } // Call up the next cycle of the ticker setTimeout("runTheTicker()", myTimeout); } // Widget generator function whatWidget() { if(theCurrentLength == theStorySummary.length) { return theWidgetNone; } if((theCurrentLength % 2) == 1) { return theWidgetOne; } else { return theWidgetTwo; } } // --> </script> <script language="JavaScript" type="text/javascript"> <!-- var theCharacterTimeout = 50; var theStoryTimeout = 5000; var theWidgetOne = "_"; var theWidgetTwo = "-"; var theWidgetNone = ""; var theLeadString = "LATEST: "; var theSummaries = new Array(); var theSiteLinks = new Array(); var theItemCount = 4; theSummaries[0] = "The government decides that the UVF ceasefire is over after days of riots. More soon."; theSiteLinks[0] = "/1/hi/default.stm"; theSummaries[1] = "The Millennium Dome's former lighting chief is jailed over a huge fraud."; theSiteLinks[1] = "/1/hi/uk/4243850.stm"; theSummaries[2] = "Bosnian Serb war crimes suspect, Sredoje Lukic, surrenders. "; theSiteLinks[2] = "/1/hi/world/europe/4243810.stm"; theSummaries[3] = "New Orleans nursing home owners charged with negligent homicide."; theSiteLinks[3] = "/1/hi/world/americas/4243678.stm"; startTicker(); //--> </script> </body> </html> It's URL is http://news.bbc.co.uk/nol/ukfs_news/hi/front_page/ticker.stm Link to comment Share on other sites More sharing options...
Shearergol 0 Posted September 14, 2005 Share Posted September 14, 2005 OK, quick question. Where do you put the first code, and where do you put the second code? Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 14, 2005 Share Posted September 14, 2005 it was gone midnight, i literally lifted the code off the page. Haven't had time to interrogate it yet! I'll have a closer look later on... Link to comment Share on other sites More sharing options...
adios 717 Posted September 14, 2005 Share Posted September 14, 2005 Glad to see I'm not the only one who uses this approach to coding! Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 14, 2005 Share Posted September 14, 2005 indeedy.... It is the only way to go... Pud, the javascript on the BBC News site is imbedded in the header section. They've got: <script src="http://newsimg.bbc.co.uk/nol/shared/js/nol4.js" language="JavaScript" type="text/javascript"></script> <script src="http://newsimg.bbc.co.uk/nol/ukfs_news/js/av.js" language="JavaScript" type="text/javascript"></script> <script src="http://newsimg.bbc.co.uk/nol/shared/js/csf_2.js" language="JavaScript" type="text/javascript"></script> So I guess if you 'replicate' those js files on your own server and put that in the header and use the other bits i've put above, you should be ok... BTW, Gol has successfully implemented it on his site, so it is possible! Link to comment Share on other sites More sharing options...
Shearergol 0 Posted September 14, 2005 Share Posted September 14, 2005 I guess I need to put up the workings... Put the following files in a /js folder off the root of the web directory. http://www.everytimeref.co.uk/js/nol4.js http://www.everytimeref.co.uk/js/av.js http://www.everytimeref.co.uk/js/csf_2.js Added the following code into the header of the page. <script src="/js/nol4.js" language="JavaScript" type="text/javascript"></script> <script src="/js/av.js" language="JavaScript" type="text/javascript"></script> <script src="/js/csf_2.js" language="JavaScript" type="text/javascript"></script> Then added the following code into the body. <script language="JavaScript" type="text/javascript"> <!-- // Ticker startup function startTicker() { // Define run time values theCurrentStory = -1; theCurrentLength = 0; // Locate base objects if (document.getElementById) { theAnchorObject = document.getElementById("tickerAnchor"); runTheTicker(); } else { document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>"); return true; } } // Ticker main run loop function runTheTicker() { var myTimeout; // Go for the next story data block if(theCurrentLength == 0) { theCurrentStory++; theCurrentStory = theCurrentStory % theItemCount; theStorySummary = theSummaries[theCurrentStory].replace(/"/g,'"'); theTargetLink = theSiteLinks[theCurrentStory]; theAnchorObject.href = theTargetLink; thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>"; } // Stuff the current ticker text into the anchor theAnchorObject.innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget(); // Modify the length for the substring and define the timer if(theCurrentLength != theStorySummary.length) { theCurrentLength++; myTimeout = theCharacterTimeout; } else { theCurrentLength = 0; myTimeout = theStoryTimeout; } // Call up the next cycle of the ticker setTimeout("runTheTicker()", myTimeout); } // Widget generator function whatWidget() { if(theCurrentLength == theStorySummary.length) { return theWidgetNone; } if((theCurrentLength % 2) == 1) { return theWidgetOne; } else { return theWidgetTwo; } } // --> </script> <script language="JavaScript" type="text/javascript"> <!-- var theCharacterTimeout = 50; var theStoryTimeout = 5000; var theWidgetOne = "_"; var theWidgetTwo = "-"; var theWidgetNone = ""; var theLeadString = "LATEST: "; var theSummaries = new Array(); var theSiteLinks = new Array(); var theItemCount = 4; theSummaries[0] = "Your first headline here."; theSiteLinks[0] = "link1.html"; theSummaries[1] = "Your second headline here."; theSiteLinks[1] = "link2.html"; theSummaries[2] = "Your third headline here."; theSiteLinks[2] = "link3.html"; theSummaries[3] = "Your fourth headline here."; theSiteLinks[3] = "link4.html"; startTicker(); //--> Then I added this to my style.css file. a.tickl{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;line-height:12px;text-decoration:none;color:#CCCCCC;font-weight:bold;} a.tickl:hover{color:#6666CC;text-decoration:none;} .ticki{width:437px;height:12px;overflow:hidden;} .ticko{width:437px;border-top:1px solid #FFFFFF;border-bottom:1px solid #990000;padding:1px 0 4px 0;margin:4px 0 0px 0;display:block;} .tickls{color:#FFF;font-weight:bold;} .tickh{display:none;} If you visit here you'll see a working version. Link to comment Share on other sites More sharing options...
peasepud 59 Posted September 15, 2005 Author Share Posted September 15, 2005 Cheers gents, you're reward is there. Link to comment Share on other sites More sharing options...
Shearergol 0 Posted September 15, 2005 Share Posted September 15, 2005 Cheers gents, you're reward is there. 33125[/snapback] Southern? Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 Cheers gents, you're reward is there. 33125[/snapback] Southern? 33180[/snapback] I said exactly the same thing! Link to comment Share on other sites More sharing options...
peasepud 59 Posted September 15, 2005 Author Share Posted September 15, 2005 Cheers gents, you're reward is there. 33125[/snapback] Southern? 33180[/snapback] I said exactly the same thing! 33208[/snapback] Scunthorpe? its south of the water innit guv'nor? gor blimey mate. Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 What have I got to do with Scunthorpe?? Link to comment Share on other sites More sharing options...
peasepud 59 Posted September 15, 2005 Author Share Posted September 15, 2005 What have I got to do with Scunthorpe?? 33807[/snapback] but Gol lives there and you're Gol and Gols you and Im confused.. Link to comment Share on other sites More sharing options...
MrBass 2715 Posted September 15, 2005 Share Posted September 15, 2005 What have I got to do with Scunthorpe?? 33807[/snapback] Hmmm, tempting.... very tempting! Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 What have I got to do with Scunthorpe?? 33807[/snapback] Hmmm, tempting.... very tempting! 33828[/snapback] remember there's an 'S' and a 'thorpe' in there as well! Link to comment Share on other sites More sharing options...
catmag 337 Posted September 15, 2005 Share Posted September 15, 2005 Any good? Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 Bloody hell Cath, you're on a roll today! *excuse me one sec while i 'supersoaker' the two cats who are fighting in my back garden and have just woken Charlotte up! * Link to comment Share on other sites More sharing options...
catmag 337 Posted September 15, 2005 Share Posted September 15, 2005 Bloody hell Cath, you're on a roll today! *excuse me one sec while i 'supersoaker' the two cats who are fighting in my back garden and have just woken Charlotte up! * 33842[/snapback] Hope you didn't hurt them Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 A quick spray of water up their arse from 20 feet.... They've left my garden pissed off, but in one piece! In the meantime, I've got a grizzly 3 year old who won't go back to sleep!!! Link to comment Share on other sites More sharing options...
catmag 337 Posted September 15, 2005 Share Posted September 15, 2005 Sit her in front of the pooter and get her to read this....... <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <link type="text/css" rel="stylesheet" href="/nol/shared/css/news.css" /> </head> <body> <div class="ticki"><a id="tickerAnchor" href="#" target="_top" class="tickl"></a></div> <script language="JavaScript" type="text/javascript"> <!-- // Ticker startup function startTicker() { // Define run time values theCurrentStory = -1; theCurrentLength = 0; // Locate base objects if (document.getElementById) { theAnchorObject = document.getElementById("tickerAnchor"); runTheTicker(); } else { document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>"); return true; } } // Ticker main run loop function runTheTicker() { var myTimeout; // Go for the next story data block if(theCurrentLength == 0) { theCurrentStory++; theCurrentStory = theCurrentStory % theItemCount; theStorySummary = theSummaries[theCurrentStory].replace(/"/g,'"'); theTargetLink = theSiteLinks[theCurrentStory]; theAnchorObject.href = theTargetLink; thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>"; } // Stuff the current ticker text into the anchor theAnchorObject.innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget(); // Modify the length for the substring and define the timer if(theCurrentLength != theStorySummary.length) { theCurrentLength++; myTimeout = theCharacterTimeout; } else { theCurrentLength = 0; myTimeout = theStoryTimeout; } // Call up the next cycle of the ticker setTimeout("runTheTicker()", myTimeout); } // Widget generator function whatWidget() { if(theCurrentLength == theStorySummary.length) { return theWidgetNone; } if((theCurrentLength % 2) == 1) { return theWidgetOne; } else { return theWidgetTwo; } } // --> </script> <script language="JavaScript" type="text/javascript"> <!-- var theCharacterTimeout = 50; var theStoryTimeout = 5000; var theWidgetOne = "_"; var theWidgetTwo = "-"; var theWidgetNone = ""; var theLeadString = "LATEST: "; var theSummaries = new Array(); var theSiteLinks = new Array(); var theItemCount = 4; theSummaries[0] = "The government decides that the UVF ceasefire is over after days of riots. More soon."; theSiteLinks[0] = "/1/hi/default.stm"; theSummaries[1] = "The Millennium Dome's former lighting chief is jailed over a huge fraud."; theSiteLinks[1] = "/1/hi/uk/4243850.stm"; theSummaries[2] = "Bosnian Serb war crimes suspect, Sredoje Lukic, surrenders. "; theSiteLinks[2] = "/1/hi/world/europe/4243810.stm"; theSummaries[3] = "New Orleans nursing home owners charged with negligent homicide."; theSiteLinks[3] = "/1/hi/world/americas/4243678.stm"; startTicker(); //--> </script> </body> </html> 32508[/snapback] Link to comment Share on other sites More sharing options...
Craig 6700 Posted September 15, 2005 Share Posted September 15, 2005 What do you think I am....? Evil?? "Charlotte..........?" Link to comment Share on other sites More sharing options...
Shearergol 0 Posted September 16, 2005 Share Posted September 16, 2005 Cheers gents, you're reward is there. 33125[/snapback] Southern? 33180[/snapback] I said exactly the same thing! 33208[/snapback] Scunthorpe? its south of the water innit guv'nor? gor blimey mate. 33738[/snapback] It's south of "some" water yes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now