From 7944e4444f38b995b2f7516a5b4141c01ac147d0 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Thu, 27 Jun 2013 20:23:37 -0700 Subject: [PATCH] when appending to body, use fixed --- index.js | 1 + overlay.css | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/index.js b/index.js index 0327f75..4cde046 100644 --- a/index.js +++ b/index.js @@ -51,6 +51,7 @@ function Overlay(options) { this.target = options.target || 'body'; this.closable = options.closable; this.el = o(tmpl); + if ('body' == this.target) this.el.addClass('fixed'); this.el.appendTo(this.target); if (this.closable) this.el.on('click', this.hide.bind(this)); } diff --git a/overlay.css b/overlay.css index 4bf1913..6dba971 100644 --- a/overlay.css +++ b/overlay.css @@ -17,3 +17,7 @@ pointer-events: none; opacity: 0; } + +.overlay.fixed { + position: fixed; +} \ No newline at end of file