This Month
Date 17-05-2012
Time 09:45:08

AW! Google Gadgets

Switch Content Script
from Dynamic Drive

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.
Page Tags: Dynamic Drive utility code, Google Gadgets
Site Tags: crucifixion Solomon Deuteronomic history contra Celsum Joshua the cross Christendom Truth Christmas Jesus Essene Marduk tarot Israelites sun god inquisition argue
Loading
Having started to develop a feature for one reason it is characteristic of sexual selection to make a virtue of necessity and use it for another.
Who Lies Sleeping?

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: 20 December, 2010.

Give Us Your Advice on This Page

If you think this page could be improved, give us your advice. You can use various methods:

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…

There really is no direct evidence for the particular kind of supreme being described in most religious writings. But, notwithstanding this complete absence of evidence, the majority of people possess religious belief of one kind or another. It seems religious belief arises from desire rather than evidence—from internal, rather than external, forces.
Paul Lutus

Support Us!
Buy a Book

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?
The Dinosaur Heritage and the Extinction of Man
ISBN 0-9521913-0-X £7.99

The Mystery of Barabbas

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

The Hidden Jesus

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.
Website Summary

AskWhy! Blogger

↑ Grab this Headline Animator

Add Feed to Google
The Wisdom of Carl
Faith is clearly not enough for many people. They crave hard evidence, scientific proof. They long for the scientific seal of approval, but are unwilling to put up with the rigorous standards of evidence that impart credibility to that seal. What a relief it would be — doubt reliably abolished.
Carl Sagan, The Demon Haunted World (1996)