This Month
Date 14-03-2010
GMTime 17:04:55
Banner header
Styled Plain

Christian apologists argue that you can’t prove the voices aren’t real, so let’s give them the benefit of the doubt!

Switch Content Script
from Dynamic Drive

Page Tags: Dynamic Drive utility code, Google Gadgets
Site Tags: God’s Truth Christendom svg art inquisition Joshua Site A-Z Judaism Adelphiasophism the cross Israelites Christmas morality Christianity Deuteronomic history Jesus Essene Belief
Loading
Post to StumbleUpon Post to BlogMarks Post to Del.icio.us Post to Fark Post to Furl Post to Google Post to MyWeb Post to Netscape Post to NetVouz Post to Newsvine Post to Reddit Post to Scuttle Post to Shadows Post to Simpy Post to Slashdot Post to Spurl Post to Technorati Post to Wists

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…

A pastor reported on a thinly disguised Christian initiative supported by the Bush administration. A group of people discussed various topics. In one, a philosopher laid claim to being of the oldest profession. A government administrator pointed out that the earliest philosopher sat beneath a hedgerow planned by city officials. A lawyer said government planners had only carried out the law on hedges. A surgeon pointed to a feat of surgery long before hedgerows or laws had been thought of—the making of Eve from Adam’s rib. Then an engineer noted that, before man was made, the world was—an engineering feat. The colloquium continued the discussion, concluding that, as the state before the making of the world was chaos, politicians constituted the oldest profession.

Who is God? Paul or Christ?

Give or take a few, it’s been 23771 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

Popularity


AskWhy! Blogger

↑ Grab this Headline Animator

My Blog Log

IP Address Lookup
Open Standards Add Feed to Google

Visitor Map
The Wisdom of Carl
Science thrives on, indeed requires, the free exchange of ideas. Its values are antithetical to secrecy. Science holds to no special vantage points or privileged positions. Both science and democracy encourage unconventional opinions and vigorous debate. Both demand adequate reason, coherent argument, rigorous standards of evidence and honesty. Science is a way to call the bluff of those who only pretend to knowledge. It is a bulwark against mysticism, against superstition, against religion misapplied to where it has no business being. If we are true to its values, it can tell us when we are being lied to. It provides a mid-course correction to our mistakes.
Carl Sagan, The Demon Haunted World (1996)

Join the blue ribbon online free speech campaign
Join the blue ribbon online free speech campaign!