PDA

View Full Version : onclick show news



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

http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

BUT text instead of pictures! Such as this:

http://www.blocparty.com/news.php

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. :)

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

shachi
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>

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

shachi
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.

chechu
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.

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