View Full Version : onclick show news

12-19-2006, 03:32 PM
Im sure its simple to do but im lost! :( I basically want something like this:


BUT text instead of pictures! Such as this:


If you got to the above link you will see that if you click a news story it loads it in the column next to it. I guess the script would be something exactly like the thumbnail one but im lost and not good at this stuff. :confused:

Anyone help me please? I want it to work "onclick" rather than "onmouseover"

All help appreacited cheers. :)

12-19-2006, 06:16 PM
anyone out there who can help or offer advice? :confused: :(

12-19-2006, 06:21 PM
Not sure what you mean by it. The link ( http://www.blocparty.com/news.php ) you provided doesn't have the script.

But maybe you mean something like this:

The js:

function change(text){
document.getElementById("some_id").innerHTML = text;

The html:

<a href="javascript:void(0)" onclick="change('this is a test')">Test #1</a>
<a href="javascript:void(0)" onclick="change('this is a test0')">Test #2</a>
<a href="javascript:void(0)" onclick="change('this is a test1')">Test #3</a>
<div id="some_id"></div>

12-19-2006, 06:37 PM
Thats great, just goes to prove i dont know what im talking about, cheers again!

12-20-2006, 10:57 AM
Is that what you wanted? If it is then cheers, if it's not then no cheer for me.

12-27-2006, 08:52 AM
Why not just use an <iframe> ? Makes it much easier, no ?
Somtimes I wonder: why do so many people have something against <iframes> ?
It is basic, but I never had any problems with it in all different browsers.

12-27-2006, 04:44 PM
Perfect situation to use AJAX.