Solved

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

Posted on 2011-03-16
1
540 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i break an array into a couple 5 26
Hta File displays dynamic File names 4 50
HTML question 2 26
Put javascript to get dropdown value 3 22
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 learn how to dynamically set the form action using jQuery.

726 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