SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I create expanding text on my site?

    I am hoping someone out there can tell me how to create expanding text on my webpage. I am very new to website building and am using Microsoft Expression to build my website.

    Here is what I am trying to do:
    I have an article that will be posted on my main page, but it is too long to display on the page when someone first arrives (it might turn them off of my site). So what I would like to do is display half of the article, and have a button next to the last word of the last sentance, that if pushed, will expand the text of the rest of the article below what is already there.

    I would like the rest of the article to display on that page and not have to redirect them to a different page. I have seen this done a while ago, so I know it is possible, I just don't know how to do it. Can anyone help me with this? Thank you very much!

  2. #2
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also if it helps, the template that I am ussing can be found at http://www.solucija.com/home/css-templates/ . It is the template called "Internet Sharing". Usses Css as well. Thank you!

  3. #3
    SitePoint Member
    Join Date
    Nov 2007
    Location
    Thane-Vashi, Mumbai, India
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please copy the following code into any empty text file and save it as HTMl file. Then open the HTML file with your browser. It works as you expect. i have also written comments and directions in the file so that you know where to put put your first part and second part of your article.

    Code HTML4Strict:
    <html>
     
    <head>
    <script>
    function ShowPart2()
    {
    document.getElementById('part2').style["display"]="inline"
    }
    </script>
    </head>
     
    <body>
     
    <table border="0" cellpadding="0" width="400"cellspacing="0">
      <tr>
        <td width="100%" valign="top" align="left">
          <!-- First paragraph starts here, Replace below content with first paragragh of your article-->
          <h1>Google</h1>
          <p>Google Inc. (NASDAQ: GOOG and LSE: GGEA) is an American public corporation, specializing in Internet search and online advertising. The company is based in Mountain View, California, and has 15,916 full-time employees (as of September 30, 2007).[3] Google's mission statement is, "to organize the&nbsp;</p>
          <!-- First paragraph ends here.Please remember to preserve the below hyperlink -->
          <a href="javascript:ShowPart2()">Click here to continue reading</a>
     
          </td>
      </tr>
    </table>
    <table id="part2" border="0" cellpadding="0" width="400" cellspacing="0" style="display:none">
      <tr>
        <td width="100%" valign="top" align="left">
         <!-- Second paragraph starts here, Replace below content with seconf paragragh of your article-->
        Google began as a research project in January 1996 by Larry Page and Sergey Brin, two Ph.D. students at Stanford University, California.[5] They hypothesized that a search engine that analyzed the relationships between websites would produce better results than existing techniques, which ranked results according to the number of times the search term appeared on a
          page.]
        <!-- second paragraph has ended here -->
        </td>
      </tr>
    </table>
     
    </body>
     
    </html>

  4. #4
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you very much, that was just what I needed!

  5. #5
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd use divs instead of table/tr/td's

  6. #6
    SitePoint Member
    Join Date
    Nov 2007
    Location
    Thane-Vashi, Mumbai, India
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JeremyAlexander View Post
    thank you very much, that was just what I needed!
    Welcome
    Web developer: PHP-MySQL, JavaScript? http://www.w3hobbyist.com


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
  •