FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-22-2007, 05:42 AM   Postid: 160835
Benj
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jun 1999
Posts: 391
How to create this effect ?

Hi,

On my frontpage, I have a long text, much to long. I would like after the first paragraph to have a "Read more link". When user click on it, it will instantly show the rest of the text. Is this javascript ? Ajax ?

How to do this ?

Thanks,
Benj
Benj is offline   Reply With Quote
Old 09-22-2007, 07:46 AM   Postid: 160836
kitchin
Site Owner

Forum Notability:
1163 pts: A True Crowd-pleaser!
[Post Feedback]
 
Join Date: Jan 2001
Location: Virginia
Posts: 2,992
Re: How to create this effect ?

It's only AJAX if you pull in the data from the network as needed. If you just hide the data then it's good old "DHTML," which means Javascript controlling CSS.
HTML Code:
<html><head>
<script language="javascript"><!--
function toggleshow(elemid) {
  if (!document.getElementById) return; // browser check
  var elem= document.getElementById(elemid);
  if (!elem) return;
  var s= elem.style;
  if (!s) return;
  s.display= s.display=='none' ? 'block' : 'none';
  return true;
}
//--></script>
</head><body>

Intro text...
<a href="moretext.htm" onClick="return !toggleshow('extratext')">
more text</a>

<div id="extratext" style="display: none;">
...more text to read.
</div>

</body></html>
You'd have to make a "moretext.htm" page as a fallback for those with Javascript disabled, old browsers, etc.
kitchin is offline   Reply With Quote
Old 09-22-2007, 12:05 PM   Postid: 160838
Benj
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jun 1999
Posts: 391
Re: How to create this effect ?

Thanks, this is what I was looking for.
Benj is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:58 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.