Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions antiscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@
, 'height': '+=' + (this.x ? scrollbarSize() : 0)
});

/* Handle `fixed` positioned divs */
if ( this.el.css("position") === "fixed" ) {
if ( this.y ) {
if ( !isNaN(parseInt(this.inner.css("right"))) ) {
var newRight = parseFloat(this.inner.css("right")) - scrollbarSize();
this.inner.css("right", newRight + "px");
}
else if ( !isNaN(parseInt(this.inner.css("left"))) ) {
var newLeft = parseFloat(this.inner.css("left")) - scrollbarSize();
this.inner.css("left", newLeft + "px");
}
}

if ( this.x ) {
if ( !isNaN(parseInt(this.inner.css("top"))) ) {
var newTop = parseFloat(this.inner.css("top")) - scrollbarSize();
this.inner.css("top", newTop + "px");
}
else if ( !isNaN(parseInt(this.inner.css("bottom"))) ) {
var newBottom = parseFloat(this.inner.css("bottom")) - scrollbarSize();
this.inner.css("bottom", newBottom + "px");
}
}
}

this.refresh();
};

Expand Down