This Month
Date 03-09-2010
GMTime 09:49:39

AW! Google Gadgets

Styled Plain

“All churches accuse the other of unbelief. For my own part, I disbelieve them all.”
Thomas Paine

Switch Content Script
from Dynamic Drive

Page Tags: Dynamic Drive utility code, Google Gadgets
Site Tags: dhtml art Jesus Essene the cross CGText Belief argue sun god Judaism Conjectures Solomon svg art Site A-Z inquisition Truth morality Christendom
Loading

Abstract

Simple website utility from Dynamic Drive, a source of a small range of useful and relible scripts. It hides and reveals content as the reader wants it, adding to the interactivity of your page. Switch Content script — © Dynamic Drive (www.dynamicdrive.com). This notice must stay intact for legal use. Last updated April 2nd, 2005. Visit http://www.dynamicdrive.com/ for full source code.

Expand-Contract Script

© Dynamic Drive 2004-5. Contents Updated: Sunday, 21 December 2008

Dynamic Drive has some excellently reliable free DHTML and javascript scripts, some of which we use. This is one of them, a javascript for hiding content until the reader wants to see it, and is therefore interactive—just as websites should be.

▼ Contract All | ▲ Expand All

Data

This script works with virtually any content on your page to make them expandable. The two steps required are:

1. Create the header that will expand a content when clicked on. Here's an example:

<h2 onClick="expandcontent('sc1')"
style="cursor:hand; cursor:pointer"> A Heading</h2>

The part in red is the only required portion—everything else you can customize, from the header's style to even the tag used (ie: <img> instead of <h2>).

2. Specify the content that will be associated with the above and become expandable:

<div id="sc1" class="switchcontent"> JavaScript is a scripting language originally developed by Netscape..... </div> 

Only the portion in red is necessary. The ID attribute used above (ie: sc1) can be arbitrary, but must match the “sc1” specified within the header of step 1) so that the header knows which content it should expand. Now, feel free to swap the <DIV> tag used to surround your content with a different container tag, such as <span>, <p> etc.

That's It

When the page first loads, by default the participating content is contracted. The user has to click to expand it. To make any content visible from the start, use the CSS “display” property:

<div id="sc1" class="switchcontent" style="display:block"> " </div>

And that's it. The script is adaptable, and easily integrated into any apge.

Specifying the “expand” and “contract” symbols

You can use different symbols in your headers, depending on the contracted or expanded state of the DIV content. In the script of Step 1 are two variables, one for each symbol. HTML is supported, so you can specify a simple “+” and “-” symbol, use character codes, as we have here, ▲ and ▼, or use images: "<img src='a.gif'>" and "<img src='b.gif'>"

Having created your symbols, insert the code:

<span class="showstate"></span>

inside each of your header HTML (code of Step 2, as shown). The script does the rest!

Last uploaded: 21 December, 2008.

Interact

Other Websites or Blogs

Short Responses and Suggestions

* Required.  No spam




New. No comments posted here yet. Be the first one!

Before you go, think about this…

Ian Musgrave emphasises that ID is a political, not scientific movement. In many ways, it is an anti-science movement. People who are interested in knowing more about the ID movement should consult the US National Center for Science Education’s web site. A detailed examination of the ID movement and its claims can be found in the book Why Intelligent Design Fails,.

Who is God? Paul or Christ?

Give or take a few, it’s been 23777 months since the first coming of Christ ended. The Rapture can’t be long now… Can it?

AskWhy! Books

Support independent publishers and writers snubbed by big retailers.
Ask your public library to order these books.
Available through all good bookshops

Get them cheaper
Direct Order Form
Get them cheaper


© All rights reserved

Who Lies Sleeping?

Who Lies Sleeping? cover
Who Lies Sleeping?
The Dinosaur Heritage and the Extinction of Man
ISBN 0-9521913-0-X £7.99

The Mystery of Barabbas

Mystery of Barabbas cover
The Mystery of Barabbas.
Exploring the Origins of a Pagan Religion
ISBN 0-9521913-1-8 £9.99

The Hidden Jesus

Hidden Jesus cover
The Hidden Jesus.
The Secret Testament Revealed
ISBN 0-9521913-2-6 £12.99

These pages are for use!

Creative Commons License
This work by Dr M D Magee is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
Permissions beyond the scope of this license may be available at http://www.askwhy.co.uk/.

This material may be freely used except to make a profit by it! Articles on this website are published and © Mike Magee and AskWhy! Publications except where otherwise attributed. Copyright can be transferred only in writing: Library of Congress: Copyright Basics.

Conditions

Permission to copy for personal use is granted. Teachers and small group facilitators may also make copies for their students and group members, providing that attribution is properly given. When quoting, suggested attribution format:

Author, AskWhy! Publications Website, “Page Title”, Updated: day, month, year, www .askwhy .co .uk / subdomains / page .php

Adding the date accessed also will help future searches when the website no longer exists and has to be accessed from archives… for example…

Dr M D Magee, AskWhy! Publications Website, “Sun Gods as Atoning Saviours” Updated: Monday, May 07, 2001, www.askwhy .co .uk / christianity / 0310sungod .php (accessed 5 August, 2007)

Electronic websites please link to us at http://www.askwhy.co.uk or to major contents pages, if preferred, but we might remove or rename individual pages. Pages may be redisplayed on the web as long as the original source is clear. For commercial permissions apply to AskWhy! Publications.

All rights reserved.
▼ Contract All | ▲ Expand All

Website Summary

Themes

Exodus

The Resurrection

Evolution

Search

Latest Feeds

Popularity


AskWhy! Blogger

↑ Grab this Headline Animator

My Blog Log

Add Feed to Google

The Wisdom of Carl
If we are absolutely sure that our beliefs are right, and those of others wrong, that we are motivated by good, and others by evil, that the King of the Universe speaks to us, and not to adherents of very different faiths, that it is wicked to challenge conventional doctrines or to ask searching questions, that our main job is to believe and obey, then the witch mania will recur in its infinite variations down to the time of the last man.
Carl Sagan, The Demon Haunted World (1996)