Execute
Save
Share
Share link
share
share
share
Team
Public Teams
Comments
0
Created By:
Guest
Title:
Title
Description
Edit
Copy Link
Login
Email *
Password *
Login
OR
Create Account
Screen Name *
Email *
Password *
Retype Password *
Team Access Code
Register
Public CodeBins
HELP
--Select Theme--
Ambiance
Blackboard
Cobalt
Eclipse
Elegant
Erlang-Dark
Lesser-Dark
Monokai
Neat
Night
Rubyblue
Vibrant-Ink
Xq-Dark
New CodeBin
CodeBins Versions
07/26/2012- V.2
07/26/2012- V.1
Compare Versions
Recent CodeBins
View All CodeBins
Bottom of Page
In Head
On Load
On Ready
Setting
Validate
Copy
Format
Setting
Validate
Copy
Format
<style type="text/css"> /* Start of css that is not needed for the script */ body{ font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif; margin-top:0px; background-image:url('../../images/heading3.gif'); background-repeat:no-repeat; padding-top:100px; } p{ margin-top:0px; } a{ color:#660000; text-decoration:none; } /* End of css that is not needed for the script */ /* Don't delete anything below here */ .dhtmlgoodies_contentBox{ border:1px solid #317082; height:0px; visibility:hidden; position:absolute; background-color:#E2EBED; overflow:hidden; padding:2px; width:250px; } .dhtmlgoodies_content{ position:relative; font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif; width:100%; font-size:0.8em; } </style> <script type="text/javascript"> /************************************************************************************************************ (C) www.dhtmlgoodies.com, September 2005 This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. Terms of use: See http://www.dhtmlgoodies.com/index.html?page=termsOfUse Thank you! www.dhtmlgoodies.com Alf Magne Kalleland ************************************************************************************************************/ var slideDownInitHeight = new Array(); var slidedown_direction = new Array(); var slidedownActive = false; var contentHeight = false; var slidedownSpeed = 3; // Higher value = faster script var slidedownTimer = 7; // Lower value = faster script function slidedown_showHide(boxId) { if(!slidedown_direction[boxId])slidedown_direction[boxId] = 1; if(!slideDownInitHeight[boxId])slideDownInitHeight[boxId] = 0; if(slideDownInitHeight[boxId]==0)slidedown_direction[boxId]=slidedownSpeed; else slidedown_direction[boxId] = slidedownSpeed*-1; slidedownContentBox = document.getElementById(boxId); var subDivs = slidedownContentBox.getElementsByTagName('DIV'); for(var no=0;no<subDivs.length;no++){ if(subDivs[no].className=='dhtmlgoodies_content')slidedownContent = subDivs[no]; } contentHeight = slidedownContent.offsetHeight; slidedownContentBox.style.visibility='visible'; slidedownActive = true; slidedown_showHide_start(slidedownContentBox,slidedownContent); } function slidedown_showHide_start(slidedownContentBox,slidedownContent) { if(!slidedownActive)return; slideDownInitHeight[slidedownContentBox.id] = slideDownInitHeight[slidedownContentBox.id]/1 + slidedown_direction[slidedownContentBox.id]; if(slideDownInitHeight[slidedownContentBox.id] <= 0){ slidedownActive = false; slidedownContentBox.style.visibility='hidden'; slideDownInitHeight[slidedownContentBox.id] = 0; } if(slideDownInitHeight[slidedownContentBox.id]>contentHeight){ slidedownActive = false; } slidedownContentBox.style.height = slideDownInitHeight[slidedownContentBox.id] + 'px'; slidedownContent.style.top = slideDownInitHeight[slidedownContentBox.id] - contentHeight + 'px'; setTimeout('slidedown_showHide_start(document.getElementById("' + slidedownContentBox.id + '"),document.getElementById("' + slidedownContent.id + '"))',slidedownTimer); // Choose a lower value than 10 to make the script move faster } function setSlideDownSpeed(newSpeed) { slidedownSpeed = newSpeed; } </script> <body> <div> <div id="dhtmlgoodies_control"><a href="#" onclick="slidedown_showHide('box1');return false;">Try it</a></div> <div class="dhtmlgoodies_contentBox" id="box1"> <div class="dhtmlgoodies_content" id="subBox1"> <div style="color:red;"> test cont 1</div> <div> test cont 2</div> <!-- End slide down content --> </div> </div> </div> <div> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> Other content<br> <div> <div id="dhtmlgoodies_control"><a href="#" onclick="slidedown_showHide('box2');return false;">Try another box</a></div> <div class="dhtmlgoodies_contentBox" id="box2"> <div class="dhtmlgoodies_content" id="subBox2"> <!-- slide down content goes here --> This is the content of another box<br> This is the content of another box<br> This is the content of another box<br> <!-- End slide down content --> </div> </div> </div> <script type="text/javascript"> setSlideDownSpeed(4); </script> </body>
No Doc Type
HTML5
HTML 4.01 Transitional
HTML 4.01 Strict
HTML 4.01 Frameset
XHTML 1.1
XHTML 1.0 Transitional
XHTML 1.0 Strict
XHTML 1.0 Frameset
Copy
Format
Download
×
Code Description
×
Difference of Versions
HTML
CSS
JS
×
JS Error
×
CSS Error
Errors
Warnings
×
JavaScript Setting
JS Libraries:
Chrome Frame 1.0.3
Dojo 1.8.0
Dojo 1.7.3
Dojo 1.7.2
Ext Core 3.1.0
jQuery 1.8.0
jQuery 1.7.2
jQuery 1.6.0
jQuery 1.5.0
jQuery 1.4.4
jQuery 1.4.0
jQuery-min 1.7.2
jQueryUI-min 1.8.21
MooTools more-1.4.0.1-full
MooTools core-1.4.5-full
MooTools core-1.4.1-full
Prototype 1.7.1.0
script.aculo.us 1.9.0
SWFObject 2.2
Twitter Bootstrap 2.0.4
WebFont Loader 1.0.28
yui 3.5.1
User Libraries:
Upload File
JavaScript URL(s):
×
CSS Setting
CSS Libraries:
jQueryUI 1.8.21
Twitter Bootstrap 2.0.4
User Libraries:
Upload File
CSS URL(s):