Web Hosting Talk







View Full Version : JavaScript News Thing in Yahoo


LordBob
05-30-2005, 04:16 PM
If you go here:

http://news.yahoo.com/

you'll see that Yahoo now uses instantly loading tables (I think) for its news content. Clicking on one of the news sources at the top of each table instantly populates the body with links to top stories.

Is this JavaScript? Or something else?

Is there any source code publicly available that will duplicate the effect?

Thanks.

ubernostrum
05-30-2005, 05:08 PM
They're not tables. They're not "instantly loaded". All of the headlines are there in the page (look at the HTML), in DIVs with the class "moreheadlines". A rule in the CSS sets these DIVs to "display: none", and then a tiny bit of JavaScript is used to make the appropriate DIV visible (by changing that style setting) when you click on each news source.

This is an extremely simple effect, provided you know JavaScript and CSS.