Show
Ignore:
Timestamp:
12/30/08 02:05:51 (15 months ago)
Author:
paul.bakaus
Message:

demos: added opacity, revert and scroll demos
draggable: fixed positioning issue with relative positioned elements relative to the body during scroll

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.draggable.js

    r1098 r1313  
    589589 
    590590 
    591                 //This is a special case where we need to modify a offset calculated on start, since the following happened: 
     591                // This is a special case where we need to modify a offset calculated on start, since the following happened: 
    592592                // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent 
    593593                // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that 
     
    595595                if(scrolled !== false && i.cssPosition == 'absolute' && i.scrollParent[0] != document && $.ui.contains(i.scrollParent[0], i.offsetParent[0])) { 
    596596                        i.offset.parent = i._getParentOffset(); 
     597                         
    597598                } 
     599                 
     600                // This is another very weird special case that only happens for relative elements: 
     601                // 1. If the css position is relative 
     602                // 2. and the scroll parent is the document or similar to the offset parent 
     603                // we have to refresh the relative offset during the scroll so there are no jumps 
     604                if(scrolled !== false && i.cssPosition == 'relative' && !(i.scrollParent[0] != document && i.scrollParent[0] != i.offsetParent[0])) { 
     605                        i.offset.relative = i._getRelativeOffset(); 
     606                } 
     607                 
    598608 
    599609        }