View Full Version : Collapsable BBC News stories - How do this?
CreativityAwait
November 6th, 2006, 08:29 AM
Hey all, you've probably noticed the collapsable sections on the BBC news site, where you can open and close the sections on the site.
How do they do this? Anyone seen any good tutorials on this?
Thanks, Andy
simplistik
November 6th, 2006, 09:14 AM
links.... for us non UK folks
CreativityAwait
November 6th, 2006, 09:30 AM
Sorry...
http://news.bbc.co.uk/
The parts i'm talking about are in the middle i.e. "Video and Audio News". "Tv and Radio Programmes" etc.
Hopefully will shw up the same as here.
raz
November 6th, 2006, 09:51 AM
You could simply use javascript / css with changing the visibility of a selected <div></div>... If youre looking for a tutorial, google phrases as "change visibility with javascript" and just read articles.
The basic concept you want to go with is having a link that says show/hide, when clicked, javascript changes the visibility of a specified <div> id. Javascript function may look something like - which is poorly written, but gives an overview -
javascript---
function changeDiv(id) {
var divId = id;
if (get current state, if its hidden) {
document.getElementById(id).style.visibility = "hidden";
}
else {
document.getElementById(id).style.visibility = "visible";
}
/script
Again - the above is just to give you a concept of what you should do... Work with it.
Sorry if its not quite what youre looking for.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.