Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2014 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/92fc55a7bde8e85f33e6 to your computer and use it in GitHub Desktop.
Save anonymous/92fc55a7bde8e85f33e6 to your computer and use it in GitHub Desktop.
Chiphell
this.run = function() {
var fixedheight = 0;
if (this.openflag && this.nvdata.next) {
var nvnexttop = document.body.scrollTop || document.documentElement.scrollTop;
var dofixed = nvnexttop !== 0 && document.documentElement.clientHeight >= 15 && this.nvdata.next.getBoundingClientRect().top - this.nvdata.height < 0;
if (dofixed) {
if (this.nv.style.position != 'fixed') {
this.nv.style.borderLeftWidth = '0';
this.nv.style.borderRightWidth = '0';
this.nv.style.height = this.nvdata.height + 'px';
this.nv.style.width = this.nvdata.width + 'px';
this.nv.style.top = '0';
this.nv.style.left = this.nvdata.left + 'px';
this.nv.style.position = 'fixed';
this.nv.style.zIndex = '199';
this.nv.style.opacity = 0.85;
}
} else {
if (this.nv.style.position != this.nvdata.position) {
this.reset();
}
}
if (this.nv.style.position == 'fixed') {
fixedheight = this.nvdata.height;
}
}
return fixedheight;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment