PDA

View Full Version : Drop-in Content Box Top not working



wayne_56
11-01-2009, 11:31 PM
1) Script Title: Dropinbox - Drop-in Content Box

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici.../dropinbox.htm

3) Describe problem:
The script does not respect the TOP attribute of the DIV that specifies the drop-in box behavior - the Width, Left and other attributes work fine. Changing or removing the TOP attribute has no impact on the placement of the box. I have tested the script in a clean HTML pages using IE8 and the latest version of Firefox. I am assuming that the box should appear at the top of the page and slide down the page and stop at the position that is set by the TOP attriubute.

Any help would be appreciated.

ddadmin
11-02-2009, 07:33 AM
The top value is programmatically set in the script, so in order to alter it, you need to do so in the script. I've highlighted the two values in red that need to be changed, in the below case, to 300:


function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-300+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<300+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}