PDA

View Full Version : DD Docking Script



Philip101
07-28-2010, 03:35 PM
Hello all,

I have just started using this Dynamic Drive Docking script: http://www.dynamicdrive.com/dynamicindex17/dockcontent.htm
...and it's working very well - thank you.

I would like to make it stop docking at a certain point on the scrolled down screen. Is this possible?
If you go to this test page and scroll down you'll see why it needs to stop (just as the first list stops) http://www.colombart.co.uk/artist_index2.html

Any suggestions? I would really like to know.

cheers, P

ddadmin
07-28-2010, 06:55 PM
Hmm this one is turning out to be a bit more complicated than I had thought. I'll try and revisit this thread in the next couple of days if possible to take another stab at the request.

vwphillips
07-29-2010, 08:49 AM
perhaps


function dockornot(obj){
var top=0;
obj.pagetop=truebody().scrollTop;
if (obj.pagetop>obj.elementoffset) //detect upper offset
top=obj.pagetop-obj.elementoffset+offsetfromedge;
else if (obj.pagetop+obj.docheight<obj.elementoffset+parseInt(obj.source.height)) //lower offset
top=obj.pagetop+obj.docheight-obj.source.height-obj.elementoffset-offsetfromedge;
obj.source.style.top=Math.min(top,500)+'px'; // 500 is the scroll limit, change as required
}

Philip101
07-29-2010, 04:27 PM
Hi Vic, that has worked perfectly, thank you very much for taking the time.
All the best,

Philip