Advanced Search

Results 1 to 7 of 7

Thread: onclick show news

  1. #1
    Join Date
    Jul 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question onclick show news

    Im sure its simple to do but im lost! I basically want something like this:

    http://www.dynamicdrive.com/dynamici...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.

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

    All help appreacited cheers.

  2. #2
    Join Date
    Jul 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    anyone out there who can help or offer advice?

  3. #3
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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:
    Code:
    function change(text){
    document.getElementById("some_id").innerHTML = text;
    }
    The html:
    Code:
    <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>

  4. #4
    Join Date
    Jul 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thats great, just goes to prove i dont know what im talking about, cheers again!

  5. #5
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is that what you wanted? If it is then cheers, if it's not then no cheer for me.

  6. #6
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    797
    Thanks
    86
    Thanked 2 Times in 2 Posts

    Default

    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.

  7. #7
    Join Date
    Dec 2006
    Location
    Raleigh, NC
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Perfect situation to use AJAX.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •