Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Previewing Text in A Website


  • This topic is locked This topic is locked

#1
Joeturf

Joeturf

    Member

  • Member
  • PipPipPip
  • 158 posts
Hi G2G.

I want to show a little bit of a paragraph of text on a website and have a "Show More..." link at the end of the small snippet of it. When the user clicks it, the rest of the text is shown in the same website.

For example, I want a paragraph of text to show up like this when the website first loads.

The digital camera is a handy invention. It allows ... (more)

The (more) part should be a link. And when a user clicks on that (more) link the text should expand, like this:

The digital camera is a handy invention. It allows people to access photographs in a whole new fashion. For example, one can simply access all their pictures from the comfortable seat in front of their computer. (less)

The (less) part should also be a link that contracts the text. Just backwards of what the (more) link did.

Let me know if I need to explain this problem more I don't know if I've explained it enough.

Thanks!!
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Hi:

I haven't played with this to see if it works or will do what you want, but check it out and see if you can use it:

Show/Hide Links

Refers to blogging posts, but may work.

Ron
  • 0

#3
Tyger

Tyger

    Member 2k

  • Member
  • PipPipPipPipPip
  • 2,896 posts
This seems to be what you're looking for. From Dynamic Drive of course!

http://www.dynamicdr...itchcontent.htm
  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
OK, this one works:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>More Text Script</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<meta name="generator" content="Matrix Y2K from van IJperen Software Inc. - [url="http://www.crystalfibers.com">"]http://www.crystalfibers.com">[/url]
&lt;script type="text/JavaScript">
function InstShow()
{
document.getElementById('dID0').style.display = (document.getElementById('dID0').style.display == 'none') ? 'block' : 'none';
document.f1.SList.focus();
}
</script>
</head>
<body>
Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco <a href="java script: InstShow();"><font color="red"><b>Read More</b></font></a>
<div id="dID0" style="display: none; background-color: #FFF0D0"> sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret. nam quibusdam, et iis quidem non admodum indoctis, totum hoc displicet philosophari. quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur. erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant in Graecis legendis operam malle consumere. postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.
</div>
</body>
</html>

When you click the Read More link, it will display the rest of the text.

Ron

Ron

Edited by Major Payne, 20 March 2007 - 12:52 AM.

  • 0

#5
Joeturf

Joeturf

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 158 posts
Thanks guys! Yet another demonstration of Website Magic :whistling:
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
You're most welcome. Glad its working for you and indeed it seems like "Website Magic" sometimes...when it works!!! :whistling:

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP