Changeset 683
- Timestamp:
- 01/22/07 11:28:53 (6 years ago)
- Files:
-
- 1 modified
-
trunk/XinhaCore.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r682 r683 2061 2061 if ( panel && panel.style.display != 'none' ) 2062 2062 { 2063 try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 2063 2064 panel.style.display = 'none'; 2064 2065 this.notifyOf('panel_change', {'action':'hide','panel':panel}); 2065 //try { this.scrollToElement();} catch(e) { }2066 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2066 2067 } 2067 2068 }; … … 2071 2072 if ( panel && panel.style.display == 'none' ) 2072 2073 { 2073 panel.style.display = ''; 2074 try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 2075 panel.style.display = ''; 2074 2076 this.notifyOf('panel_change', {'action':'show','panel':panel}); 2075 //try { this.scrollToElement();} catch(e) { }2077 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2076 2078 } 2077 2079 }; … … 5501 5503 }; 5502 5504 5505 Xinha.prototype.scrollPos = function(scope) 5506 { 5507 scope = (scope) ? scope : window; 5508 var x,y; 5509 if (scope.pageYOffset) // all except Explorer 5510 { 5511 x = scope.pageXOffset; 5512 y = scope.pageYOffset; 5513 } 5514 else if (document.documentElement && document.documentElement.scrollTop) 5515 // Explorer 6 Strict 5516 { 5517 x = scope.document.documentElement.scrollLeft; 5518 y = scope.document.documentElement.scrollTop; 5519 } 5520 else if (document.body) // all other Explorers 5521 { 5522 x = scope.document.body.scrollLeft; 5523 y = scope.document.body.scrollTop; 5524 } 5525 return {'x':x,'y':y}; 5526 }; 5527 5503 5528 /** 5504 5529 * Calculate the top and left pixel position of an element in the DOM.
