Showing / Hiding text when a link is clicked

It's sometimes useful to hide text on a page and only show it when a user clicks a relevant link. On a Frequently Asked Questions (FAQ) page for example. Try the following links. Click to show, click to hide again.

 What is Microsoft FrontPage?

 What is MSN Search?


How?

Copy the following JavaScript function within the head tags of your page:

Now, as an example, copy the code below into the body of your page.

All you need then is to copy the '+' and '-' images straight off this page. Right-Click the image then 'Save Picture As' and select where you want to save it, for this example the 'images' folder of the site where the page is located.

 




Expression Blend and Design
  • Cutting Shapes in Expression Blend Currently, Expression Blend does not have a scissor tool which allows you to cut shapes like you can in Expression Design. Instead, what you do have are geometric operations that allow you to not only achieve a similar result as “cutting a shape” but...(read more)
  • How to Animate a Drawing Line In Blend you use the Pen tool to draw lines and they appear in the XAML as <Path> elements. But after you’ve drawn your lines and you test your application, the Paths appear immediately: they don’t replay the gestures you used to create...(read more)
  • Do You Want to Help Implement Interesting Ideas? The Blend Team needs you! A few months ago, we asked you for feedback on what are some of the things you would like to see improved in Expression Blend. You all had a lot of great suggestions...A LOT. If you are interested in helping us both implement some of the feedback but...(read more)
  • Deep Zoom Composer Updated (Again!) To address many of the issues you all had with the PhotoZoom functionality, we have released an updated preview version of Deep Zoom Composer. You can download the updated version from the following link: Download Deep Zoom Composer Be sure to uninstall...(read more)
  • Download the New Deep Zoom Composer Preview! A few hours ago, we released another update to Deep Zoom Composer. Click on the link below to download it: Download Deep Zoom Composer Some of the major new features outside of the usual bug, performance, and stability changes include Panoramic Stitching...(read more)
  • Collection of Expression Blend Learning Resources This post will try to showcase an updated list of useful (and free!) training material available for Expression Blend: Training Resources from Microsoft Expression Blend and Design Blog: Tips & Tricks Expression Community Expression Blend (Online)...(read more)
  • Where do You Go to Learn More About Expression Blend? One of the things that we are planning on doing is providing easier access to learning content. Besides the influx of learning content (videos, articles, etc.) we will be generating ourselves, we also want to link to content around the web that many of...(read more)
  • Animating control Content between States You’re probably very familiar with Content in WPF and Silverlight. For example, two Buttons can use the same Template but can look different by virtue of having different Content in them. And the Content property is of type object so it can be Text, or...(read more)
  • More articles on Visual State Manager Karen Corby is the Program Manager who worked with the Expression Blend team in developing the Visual State Manager feature. Karen has written four excellent and comprehensive blog posts ( starting here ) which explain the motivation for VSM, everything...(read more)
  • Deep Zoom Composer : (Possible) Collection Layout FIX If you’ve browsed through the Deep Zoom Composer forums lately, you will have seen a few cases where Deep Zoom Composer was having difficulties maintaining layout when exporting collections. More specifically, the arrangement and position of images seen...(read more)
  • Nibbles Tutorials: Snack Tutorials for Hungry Designers A great site that covers designer-oriented Expression Blend topics is Celso Gomes’s Nibbles Tutorials site: This all-Silverlight site features some nice articles on how you can use Blend to create WPF, Silverlight 1, and Silverlight 2 applications. He...(read more)
  • Debugging Design-Time Exceptions It’s not entirely uncommon for projects that run fine to not work when loaded into Blend for editing: There are a variety of issues that can cause this- some are bugs that we’re working to address, others are things that need to be fixed by the application...(read more)
  • Localization and What Goes on Behind the Scenes Many of you may not know that Expression Blend (and the entire Expression Studio) is available in eight languages other than English. In fact, we just released them earlier today! Here is a small screenshot of Expression Blend running Japanese: My name...(read more)
  • What’s new in Deep Zoom Composer! Yesterday, we released another update to Deep Zoom Composer, and you can download it for free from the following location: Download Deep Zoom Composer In case you are not familiar with this app, Deep Zoom Composer (DZC) allows you take images, arrange...(read more)
  • Download Expression Blend 2.5 June 2008 Preview and Deep Zoom Composer Like we mentioned earlier this week , new preview versions of Expression Blend 2.5 and Deep Zoom Composer have been released today. You can download them from the following locations: Download Expression Blend 2.5 June 2008 Preview Download Deep Zoom...(read more)