Making text vanish by changing it's style

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Paul Suderman
Posts: 33
Joined: Mon Dec 07, 2015 6:11 pm

Making text vanish by changing it's style

Unread post by Paul Suderman »

Hi there,

I've got a block of text that looks like this:

Image

I'm wondering if there is a way in WebHelp (and maybe CHM) to make the green text disappear at the click of the mouse, then reappear with another click. What I'm trying to get to is the possibility of a cleaner read (without the green text) and then a complete read (with the green text).

The green text has its own style, if that helps.

Thanks,

Paul
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: Making text vanish by changing it's style

Unread post by Simon Dismore »

How about using expanding inline text toggles with a expand/collapse all feature in the topic page template header?
Paul Suderman
Posts: 33
Joined: Mon Dec 07, 2015 6:11 pm

Re: Making text vanish by changing it's style

Unread post by Paul Suderman »

Hey Simon,

That is an awesome idea! I have expanding table toggles elsewhere on the page - is there any way to expand only the inline toggles and not the table toggles?

Thanks again for the great suggestion!

Paul
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: Making text vanish by changing it's style

Unread post by Simon Dismore »

Paul Suderman wrote:is there any way to expand only the inline toggles and not the table toggles?
Over to Tim for that one... :wink:
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Making text vanish by changing it's style

Unread post by Tim Green »

Paul Suderman wrote:I have expanding table toggles elsewhere on the page - is there any way to expand only the inline toggles and not the table toggles?
There isn't a built in function for this but here's one you can add:

Code: Select all

<script>var HMInlineTogglesAllExpanded = false;
var HMInlineToggles = $("a.inline-toggle").next("span");
var HMToggleExpandAllInline = function(value) {
	var doexpand = typeof value != "undefined" ? value : !HMInlineTogglesAllExpanded;
  if (HMInlineToggles.length != null){ 
    for (i=0; i<HMInlineToggles.length; i++){ 
      HMToggleExpand(HMInlineToggles[i], doexpand, (doexpand && hmAnimate)); 
	}
  }
  HMInlineTogglesAllExpanded = doexpand;
}</script>
Add the code above to your HTML page template (in the skin if you are using a skin) directly before the closing </body> tag at the bottom of the page. Using it is similar to the normal expand all function but you can use it both to toggle all inline toggles on and off, and to specifically open or close all toggles:

Toggle on/off: HMToggleExpandAllInline()
Open all closed inline toggles: HMToggleExpandAllInline(true)
Close all open inline toggles: HMToggleExpandAllInline(false)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Paul Suderman
Posts: 33
Joined: Mon Dec 07, 2015 6:11 pm

Re: Making text vanish by changing it's style

Unread post by Paul Suderman »

Fantastic!!

Thanks so much!

Paul
Post Reply