Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expand to read more...HTML!

Status
Not open for further replies.

madcaesar

Technical User
Feb 6, 2009
1
0
0
US
Ok here is my problem. I have posting of jobs. And all the jobs have a couple of paragraphs of description on them. Now I want to show just a few sentences of each description and then have a colapse/expand "read more" type of thing. Now I've got it working with my code and JavaScript, however it breaks in FireFox if there is HTML in the descriptor. If there is a <ul><li> elment it will read that and expand the box. Here is the code I use:

<cfset tmp = Find(" ",JobDescription,100)-1>
<cfif tmp lte 0>
#ParagraphFormat(JobDescription)#
<cfelse>
#Left(JobDescription,tmp)#
<span id="#JobID#" style="display:none;">
#Mid(JobDescription,tmp+1,Len(JobDescription))#
</span>
<span class="linkMore"><A HREF="javascript:showHideDescriptions('#JobID#')">more +/-</a></span>
</cfif>


Has anyone tried to do something similar before? any tips on how to go about this? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top