<A HREF="http://a.tribalfusion.com/h.click/aXmxY15taN5PjInrvKXcfYXcn40cBnmTFS3bFVVrFFWP7XPEY5PVQOStZbwYH7qV6bv3GM4XUUZcUmXn2PFdR6BK2dZbr0tBJmdZaN363Y5Gj7VcnjWGB7S6ryUtMPWFJPQVADP59RgV/http://zwinky.smileycentral.com/download/index.jhtml?partner=ZJxdm1471440316760" TARGET="_blank"><IMG SRC=http://cdn5.tribalfusion.com/media/743026/Zcpt3_GothSwap_728x90.jpg WIDTH=728 HEIGHT=90 BORDER=0></A>

Home / Free JavaScripts / Other / Here

JavaScript Kit

Cut & Paste Content Tabs script

Credit: JavaScript Kit

Description: Use this versatile script to divide long content on your page into "virtual" sections, with each section viewable by clicking on a corresponding tab. It's a great way to display your content in an interactive, less overwhelming way to your visitors. This is the same script used on our Free JavaScripts entrance page.

This script works in both IE5+ and NS6/Firefox, and degrades well with the rest (all content is shown at once in the last case).

Example:

Live Server Time script
This unique JavaScript allows you to display the server time of your website, live! Using either SSI or PHP (depending on which one your page supports) to first retrieve the current static server time, the script then updates it every second for display. Cool!

Block IP address script
Use this script to block certain IPs from your webpage, by redirecting them to another site. Note that your web server must have SSI enabled for this script to work.

Page 1 Page 2 Page 3

Directions:

Step 1: Insert the below code to the HEAD section of your page:

Since the above code references two external files, you need to download them and upload to your webpage directory. They are: contentdivider.js and tabstyle.css. Just right click each link and select "Save As." to save the two files.

Step 2: Add the below HTML code to your page. It demonstrates how to divide 3 pieces of content into 3 tabs:

More Information

This script is very easy to implement. Firstly, open up "contentdivider.js" using any text editor, and edit the 3 variables per the comments, most importantly, the number of content to show per each tab.

Moving on, the HTML code of Step 2 looks like this:

<div id="cyclelinks"></div>

<p class="dropcontent">

Content 1 here.

</p>

<p class="dropcontent">

Content 2 here.

</p>

<p class="dropcontent">

Content 3 here.

</p>

<div id="cyclelinks2" align="right"></div>

Do not remove the top and bottom DIV tags (in red), as they are used by the script to show the Navigational Tabs and bottom navigational links, respectively. For each piece of content, simply wrap them each in a container tag with class="dropcontent", such as <p class="dropcontent"></p>. The script will then create tabs to divide the contents per the number specified in "contentdivider.js."


Copyright © 1997-2007 JavaScript Kit. NO PART may be reproduced without author's permission.

CSS Library | JavaScript & DHTML Menus | CSS Drive  | Java Online Blackjack | Web hosting Search
Web Development | Cheap Printer Ink | DaniWeb IT Discussion Community | Web hosting | -Windows Hosting