Changeset 246 for trunk/ippu.js

Show
Ignore:
Timestamp:
11/14/07 20:29:51 (2 years ago)
Author:
henrylyne
Message:

When displaying IPPU without a fixed position, take into account window scroll when centering.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ippu.js

    r222 r246  
    405405    var cd = DOM.getClientDimensions(); 
    406406    var newleft = cd.x / 2 - DOM.getDimensions(this.ele).offsetWidth / 2; 
    407     DOM.setLeft(this.ele, newleft); 
     407 
     408    // If not fixed position, center relative to the left of the page 
     409    if (!this.fixedPosition) { 
     410        var wd = DOM.getWindowScroll(); 
     411        newleft += wd.left; 
     412    } 
     413 
     414   DOM.setLeft(this.ele, newleft); 
    408415  }, 
    409416 
     
    413420    var cd = DOM.getClientDimensions(); 
    414421    var newtop = cd.y / 2 - DOM.getDimensions(this.ele).offsetHeight / 2; 
     422 
     423    // If not fixed position, center relative to the top of the page 
     424    if (!this.fixedPosition) { 
     425        var wd = DOM.getWindowScroll(); 
     426        newtop += wd.top; 
     427    } 
     428 
    415429    DOM.setTop(this.ele, newtop); 
    416430  },