Solved

jquery replace 'show detail' with 'hide detail' text

Posted on 2011-03-16
1
538 Views
Last Modified: 2012-05-11
http://test.production.esa.edu.au/NDLRN/ndlrnCatalog/final.html

I got the accordian effect working, but the 'show detail' text needs to be replaced with 'hide detail' when it is clicked on.

replace 'show detail' with 'hide detail' and vice versa when clicked on again.

here's some of the key code i added to the jquery:

in .find("h3") i added .prepend('<span class="showHide" style="float:right;">Show Details</span>')
0
Comment
Question by:jeremyll
1 Comment
 
LVL 3

Accepted Solution

by:
ccwill88 earned 500 total points
ID: 35153600
use html() to modify :

.click(function() {
      $(this)
 	.html('<span class="showHide">HIDE Details</span>')
	    .toggleClass("ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom")
        .next().toggleClass("ui-accordion-content-active").slideToggle();		
      return false;
    })

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question