Advertisement

i need help

Moderators: Calcifer, slothy

i need help

Postby asad86 » Mon May 15, 2006 5:58 pm

there is script below this message

the question is there any of making this script stop sliding at certain amount of height because this messes web design.
also i want a scroll bar so the user can scroll through this script

script code as follows

<style type="text/css">

body{
font-family: Helvetica, Lucida Sans Unicode, Arial, sans-serif; /* Font to use */
margin:0px;

}

.dhtmlgoodies_question{ /* Styling question */
/* Start layout CSS */
color:brown;
font-size:0.9em;
background-color:white;
width:430px;
margin-bottom:2px;
margin-top:2px;
padding-left:2px;
background-image:url('images/bkg1.bmp');
background-repeat:no-repeat;
background-position:top right;
height:20px;

/* End layout CSS */

overflow:hidden;
cursor:pointer;
}
.dhtmlgoodies_answer{ /* Parent box of slide down content */
/* Start layout CSS */
border:0px solid #317082;
background-color:#E2EBED;
background-image:url('images/bkg.bmp');
width:430px;
color:#FFF;
/* End layout CSS */

visibility:hidden;
height:0px;
overflow:hidden;
position:relative;

}
.dhtmlgoodies_answer_content{ /* Content that is slided down */
padding:1px;
font-size:0.9em;
position:relative;
}

</style>

<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<script type="text/javascript">
/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 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:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.


Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

Updated:
April, 3rd, 2006: Fixed problem with initial sliding in IE.

************************************************************************************************************/

var dhtmlgoodies_slideSpeed = 10; // Higher value = faster
var dhtmlgoodies_timer = 10; // Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
function showHideContent(e,inputId)
{
if(!inputId)inputId = this.id;
inputId = inputId + '';
var numericId = inputId.replace(/[^0-9]/g,'');
var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

objectIdToSlideDown = false;

if(!answerDiv.style.display || answerDiv.style.display=='none'){

if(dhtmlgoodies_activeId && dhtmlgoodies_activeId!=numericId){
objectIdToSlideDown = numericId;
slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
}else{

answerDiv.style.display='block';
answerDiv.style.visibility = 'visible';

slideContent(numericId,dhtmlgoodies_slideSpeed);
}
}else{
slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
dhtmlgoodies_activeId = false;
}
}

function slideContent(inputId,direction)
{
var obj =document.getElementById('dhtmlgoodies_a' + inputId);
var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
height = obj.clientHeight;
height = height + direction;
rerunFunction = true;
if(height>contentObj.offsetHeight){
height = contentObj.offsetHeight;
rerunFunction = false;
}
if(height<=1){
height = 1;
rerunFunction = false;
}

obj.style.height = height + 'px';
var topPos = height - contentObj.offsetHeight;
if(topPos>0)topPos=0;
contentObj.style.top = topPos + 'px';
if(rerunFunction){
setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
}else{
if(height<=1){
obj.style.display='none';
if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);
}
}else{
dhtmlgoodies_activeId = inputId;
}
}
}



function initShowHideDivs()
{
var divs = document.getElementsByTagName('DIV');
var divCounter = 1;
for(var no=0;no<divs.length;no++){
if(divs[no].className=='dhtmlgoodies_question'){
divs[no].onclick = showHideContent;
divs[no].id = 'dhtmlgoodies_q'+divCounter;

var answer = divs[no].nextSibling;
while(answer && answer.tagName!='DIV'){
answer = answer.nextSibling;
}

answer.id = 'dhtmlgoodies_a'+divCounter;

contentDiv = answer.getElementsByTagName('DIV')[0];
contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';
contentDiv.className='dhtmlgoodies_answer_content';
contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
answer.style.display='none';
answer.style.height='1px';
divCounter++;
}
}
}
window.onload = initShowHideDivs;
</script>

in body the code i have

//this is table i am only giving a bit code

<tr>
<td><div class="dhtmlgoodies_question">2006 Events</div>
<div class="dhtmlgoodies_answer">
<div>
<table goes here calender>
</div>
</div></td>
</tr>
asad86
 
Posts: 1
Joined: Mon May 15, 2006 5:53 pm

Return to Questions regarding other scripts at www.dhtmlgoodies.com

Who is online

Users browsing this forum: No registered users and 2 guests

cron