SitePoint Sponsor

User Tag List

Results 1 to 1 of 1

Hybrid View

  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    changing the table or text per 5 seconds

    Code:
    <script type=text/javascript>
    function hide()
    {
    document.getElementById('xTable1').style.display = "none"; 
    document.getElementById('xTable2').style.display = "none";
    document.getElementById('xTable3').style.display = "none";
    }
    function change(tablediv)
    {
    hide();
    document.getElementById(tablediv).style.display = "block";
    }
    </script>
    
     <a href="javascript:change('xTable1');">link1</a>
     <a href="javascript:change('xTable2');">link2</a>
     <a href="javascript:change('xTable3');">link3</a>
    
    <table id='xTable1' cellpadding='0' cellspacing='0' border='0'  style="display:block">
    <tr><td>table1</td></tr>
    </table>
    <table id='xTable2'  cellpadding='0' cellspacing='0' border='0' style='display: none'>
    <tr><td>table2</td></tr>
    </table>
    <table id='xTable3'  cellpadding='0' cellspacing='0' border='0' style='display: none'>
    <tr><td>table3</td></tr>
    </table>
    With the code above,
    If a user clicks the link1, table1 will be shown.
    If the user clicks the link2, table2 will be shown.
    If the suer clicks the link3, table3 will be shown.

    It works fine.

    Now I am telling you what I want.

    When the page is loading, table1 will be shown.
    After 5 seconds later, table1 or text1 will be disapeared and table2 or text2 will be shown without any clicks or mouse-over.
    After another 5 seconds later, table2 or text2 will be disapeared and table3 or text3 will be shown without any clicks or mouse-over.
    After another 5 seconds later, table3 or text2 will be disapeared and table1 or text1 will be shown without any clicks or mouse-over.

    Can I make it with your help?
    Last edited by dotJoon; Nov 3, 2006 at 08:41.


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
  •