Results 1 to 4 of 4

Thread: DD Docking Script

  1. #1
    Join Date
    Jul 2010
    Location
    London, UK
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default DD Docking Script

    Hello all,

    I have just started using this Dynamic Drive Docking script: http://www.dynamicdrive.com/dynamici...ockcontent.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

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Philip101 (07-29-2010)

  4. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    perhaps

    Code:
    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
    }
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  5. The Following User Says Thank You to vwphillips For This Useful Post:

    Philip101 (07-29-2010)

  6. #4
    Join Date
    Jul 2010
    Location
    London, UK
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi Vic, that has worked perfectly, thank you very much for taking the time.
    All the best,

    Philip

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •