Skip to content
This repository has been archived by the owner on Apr 29, 2018. It is now read-only.

Commit

Permalink
Addressing a problem that prevented the overlay functioning correctly…
Browse files Browse the repository at this point in the history
… in Firefox
  • Loading branch information
tommcfarlin committed Jun 24, 2011
1 parent 041ff37 commit 65f3091
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions js/jquery.overlay.js
Expand Up @@ -6,7 +6,7 @@
* Copyright 2011 Tom McFarlin, http://tommcfarlin.com, @moretom
* Released under the MIT License
*
* http://moreco.de/jquery-simple-overlay
* http://moreco.de/simple-overlay
*/

(function($) {
Expand Down Expand Up @@ -38,12 +38,19 @@
$src.addClass('overlay-trigger');

// create the overlay and add it to the dom
var iTop = 0;
if($.browser.mozilla && opts.container.toString() === 'body') {
iTop = $('html').scrollTop();
} else {
iTop = $(opts.container).scrollTop();
} // end if/else

var overlay = $('<div></div>')
.addClass('overlay')
.css({
background: opts.color,
opacity: opts.opacity,
top: opts.container.toString() === 'body' ? $(opts.container).scrollTop() : $(opts.container).offset().top,
top: opts.container.toString() === 'body' ? iTop : $(opts.container).offset().top,
left: $(opts.container).offset().left,
width: opts.container === 'body' ? '100%' : $(opts.container).width(),
height: opts.container === 'body' ? '100%' : $(opts.container).height(),
Expand Down
5 changes: 3 additions & 2 deletions js/jquery.overlay.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65f3091

Please sign in to comment.