Skip to content

Instantly share code, notes, and snippets.

@mynameisrufus
Created December 16, 2009 03:39
Show Gist options
  • Save mynameisrufus/257565 to your computer and use it in GitHub Desktop.
Save mynameisrufus/257565 to your computer and use it in GitHub Desktop.
}else if(this.options.position.length){
if(typeof(this.options.position[1]) == 'string') {
var topFinal = this.options.position[1];
} else {
var top = $value(this.options.position[1]) + $value(this.options.offsetTop);
var topFinal = (container_dimensions.height <= viewport_dimensions.height) ? (this.options.constrainToViewport ? Math.max(0,Math.min(viewport_dimensions.height - (container_dimensions.height),top)) : top) + 'px' : 0;
}
if(typeof(this.options.position[0]) == 'string') {
var leftFinal = this.options.position[0];
} else {
var left = $value(this.options.position[0]) + $value(this.options.offsetLeft);
var leftFinal = (container_dimensions.width <= viewport_dimensions.width) ? (this.options.constrainToViewport ? Math.max(0,Math.min(viewport_dimensions.width - (container_dimensions.width),left)) : left) + 'px' : 0;
}
this.container.setStyle({top: topFinal,left: leftFinal});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment