Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Adding horizontal scrolling to CNN RSS feed

Using Magpie -- setup and is working



2:40 pm on Apr 4, 2007 (gmt 0)

5+ Year Member

I am now entering my 30th hour of trying to get such an animal working. Because I see these things all over the web, when I was asked if I could do that, I said "Sure". Figuring with so much use there's got to be a lot of solution.

But, even when I was exhausted and ready to pay money -- no luck. This morning I installed the Magpie code and it is set up and running just fine.

Someone (much earlier in this sub-forum suggested using the marquee tag to make it scroll. I've tried that with an amended BBC style sheet and now I am so close it hurts. So I've come here.

Where I have the typcal vertical list with 5 or six items in it, I now have a 500px wide 30px high bordered box with the first headline in it, at the left. To me, after so much work, it looks gorgeous. BUT, of course it just sits there.

I want the CNN headlines continuously scrolling one after the other from right to left.

Can anyone help? I would probably have to email you the URLs of the involved pages. So, if some hearty soul wants to help me out, I would be most grateful!

Or, if anyone knows of a commercial product that will create this set up for me--single line, scrolling, configurable bg, fonts, and borders are necessary--and it must be displayable on a web page. I'd love the name of that program. (I've tried RSS Feed Scroller which works in the demos but not for me! Seems to be a bit buggy.

(I have been through this forum back to 2005, with only that one comment on using a marquee having anything to do with what I'm after.)


12:31 am on May 31, 2007 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month


Did you have any luck with this one?


11:23 am on May 31, 2007 (gmt 0)

5+ Year Member

Hi Bill --
No I didn't -- now I'm spending my money taking a JS class and will be signing up for the intermediate one when the first one is done.

I've also bought a couple of XML books -- I'm determined to do this if it takes me the rest of my life! lol



12:06 pm on May 31, 2007 (gmt 0)

5+ Year Member

Is it something like the ticker at the top of this page?


If so I can help you with it no problem


2:56 pm on May 31, 2007 (gmt 0)

5+ Year Member

Hi Microdot==
(Love your name!)

I went to the BBC page and it was very interesting. The news ticker at the top is close, but not what I want. I got excited because the little Listen Live button above that actually performs the way I want when you first load the page-- the whole item scrolls smoothly in from the right, followed by the next one and so on.

However, the ticker that they do have is quite nice. If it's not a big deal, I would love to know how that one works! I figure the more pieces of information I have, as well as practice, will make my project easier in the long run.

If you just add the subdir /blog to the url that is listed in my profile, you will see what I am using there. That's not where I want the long ticker, for design reasons. (The one there is the Advanced RSS Ticker from the dynamic drive site. And, it was close, with being able to format borders, size, type, etc., but of course, no scrolling.

Anyway, I'm really enjoying the JS class I'm taking, -- determination is the mother of learning! or something like that anyway.

I have a bare page with nothing but the ticker I want on it using the marquee code that Jim (from here) sent me -- it functions correctly, but I can't yet figure out how to get it to use a feed -- hence the JS class and the XML books. Again if you just add /ticker2 to my url, you can see it. All the code is in the page, (I was hoping someone would ask to see it, but no one ever did.) This is the one that I referred to in my first msg. as being so close it hurt.

Anyway, I do like the BBC ticker! Perhaps I'll start collecting them. lol

Thanks again for your interest, Micro --


7:15 pm on May 31, 2007 (gmt 0)

5+ Year Member

Thanks Clair..

Here's the code, copy and paste all this into a new page and just put in the url of the feed you want to display, the way I use it on my own site is inside an iframe (yep I know it's sloppy) but you can run it in a normal page without the iframe.

<script type="text/javascript">
var sText = ""
var i=0
var iNews=0
var rss = new ActiveXObject("Microsoft.XMLDOM")
rss.async = false

function GetNewsSource(){
var itemNodes = rss.selectNodes("/rss/channel/item")
var iMax = itemNodes.length

sText = itemNodes.item(iNews).getElementsByTagName("title").item(0).text
myTicker.href = itemNodes.item(iNews).getElementsByTagName("link").item(0).text
window.setTimeout("GetNewsSource()", (90*sText.length +4000))

function ticker(){
myTicker.innerText = sText.substring(0,i) + " _"

<body bgcolor="#B10000" text="#FFFFFF" link="#FFFFCC" vlink="#FFFFCC" alink="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="GetNewsSource()">
<a id="myTicker" href="" target="_parent"></a>

Don't forget to change your body properties and you can add CSS to this too. Good luck.


7:48 pm on May 31, 2007 (gmt 0)

5+ Year Member

Wow -- very nice.

I will be mucking about with it tomorrow morning. (I get up at 2 a.m.)
Can't wait.

I do think by the time this is over, I will have a nice collection--
did you write this one? If so I'm impressed--the code is small and clean and neat.

I do have one question-- What's this line?

var rss = new ActiveXObject("Microsoft.XMLDOM")

Thanks much, my friend.



8:20 pm on May 31, 2007 (gmt 0)

5+ Year Member

Happy to help.

ActiveXObject("Microsoft.XMLDOM acts as an XML Parser but there's probably better ways to do it to be honest.

Have fun.


10:13 am on Jun 1, 2007 (gmt 0)

5+ Year Member

M. --
Well, I've tried the page with every DOCTPE known to man, and once more without any --

Nothing but a lovely blank red window comes up and in the error console these two messages, which I have not yet had enough JS to interpret:

ActiveXObject is not defined (on the var rss line)

rss has no properties (on the var itemNodes line)

The feed I'm using is the same I use on my blog page to the cnn-worldnews rss feed.

Will keep messing about.

(AND I don't expect you to do anything at all -- just giving you a report on my morning's fiddling!)


10:18 am on Jun 1, 2007 (gmt 0)

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Clair... sounds like you are using something other than IE, and it seems to me the code will work best (only) in IE...


10:33 am on Jun 1, 2007 (gmt 0)

5+ Year Member

hi Vince --
I've tried it in IE6, IE7, and FF2 -- exact same red screen -- but I can get the error msgs. from FF's error console.

Just have to get myself further along in my JS class! This is what I call a "spur to action"! lol

Thanks for your post though. My question lay dormant for about 6 weeks -- now it has sprung to life with a vengeance!



11:35 am on Jun 1, 2007 (gmt 0)

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Are you running it from your drive (file:// / c:\/) or from a webserver (http://)?


12:20 pm on Jun 1, 2007 (gmt 0)

5+ Year Member

web server --(Apache on line)
some of the tickers I've tried I can run from my computer, but if there are any problems, I immediately try them online.

When I got the red screen, I of course tried it online, same thing.

Ah well --


Featured Threads

Hot Threads This Week

Hot Threads This Month