View Full Version : how would you create yahoo-like "read full story"?

02-21-2009, 09:55 PM
I am looking to do something similar to what yahoo does with their online stories.

If you visit http://news.yahoo.com/s/nm/20090221/ts_nm/us_obama you will see the "read full article" link at the bottom of the story, which when clicked, expands to show the whole story. Furthermore, if javascript is disabled, the whole story displays.

I haven't been able to find any examples of this and would prefer to use the jquery framework. Does anyone have any ideas as to how to do this? I am a notice when it comes to javascript.


02-21-2009, 10:30 PM
I don't see much differecne whether js is disabled or not. The whole story shows either way.

what I used to do when trying to understand why pages do what they do, is copy them to my hdd. then remove code piece by piece until I idnetify the code that does the thing I am interested in.

try that and see how you get on.


02-22-2009, 05:35 AM
If your new to javascript I recommend checking out JQuery (www.jquery.com)

Its a lightweight framework which makes powerful javascript very short and simple.

Download the minimised pack, have a little look through the documentation and then google "jquery show hide"

The basic concept is have an element with the shortened text folowed by an element with the full text.
You can either hard-code a show/hide link or have jquery add it later (better do this once u grasp the basics)

Then on page load Jquery hides the second element until its told to show it.
Provides perfect usability and compatibility with non-javascript browsers.