diff --git a/bootstro.css b/bootstro.css index aee415a..09b6022 100644 --- a/bootstro.css +++ b/bootstro.css @@ -45,4 +45,13 @@ font-weight:bold; } +.bootstro-backdrop2 +{ + position: fixed; + z-index: 2; + opacity: 0.5; + background-color: black; + filter: alpha(opacity = 50); +} + diff --git a/bootstro.js b/bootstro.js index 7d6f915..58a3d06 100644 --- a/bootstro.js +++ b/bootstro.js @@ -36,7 +36,11 @@ $(document).ready(function(){ margin : 100, //if the currently shown element's margin is less than this value // the element should be scrolled so that i can be viewed properly. This is useful - // for sites which have fixed top/bottom nav bar + // for sites which have fixed top/bottom nav bar + + showBackdrop: true, // If false, don't show the overlay. + useBackdropMethod2: false, // Use alternative method to paint backdrop. Work around when there's + // z-index stack confusion (iScroll, etc) }; var settings; @@ -180,6 +184,7 @@ $(document).ready(function(){ else if (p.title == '') p.title = t; + p.container = '#bootstro-wrapper'; p.content = $el.attr('data-bootstro-content') || ''; p.content = add_nav_btn(p.content, i); p.placement = $el.attr('data-bootstro-placement') || 'top'; @@ -234,6 +239,7 @@ $(document).ready(function(){ bootstro.destroy_popover(activeIndex); bootstro.unbind(); $("div.bootstro-backdrop").remove(); + $("div.bootstro-backdrop2").remove(); if (typeof settings.onExit == 'function') settings.onExit.call(this,{idx : activeIndex}); }; @@ -249,7 +255,11 @@ $(document).ready(function(){ var $el = get_element(idx); $el.popover(p).popover('show'); - + $('#bootstro-top').css({top: 0, left: 0, height: $el.offset().top + 'px', width: '100%'}); + $('#bootstro-left').css({top: $el.offset().top, left: 0, height: $el.outerHeight() + 'px', width: $el.offset().left + 'px'}); + $('#bootstro-right').css({top: $el.offset().top, left: -1 + $el.offset().left + $el.outerWidth() + 'px', height: $el.outerHeight() + 'px', width: '100%' }); + $('#bootstro-bot').css({top: $el.offset().top + + $el.outerHeight() + 'px', left: 0, height: '100%', width: '100%' }); + //scroll if neccessary var docviewTop = $(window).scrollTop(); var top = Math.min($(".popover.in").offset().top, $el.offset().top); @@ -314,7 +324,23 @@ $(document).ready(function(){ if (count > 0 && $('div.bootstro-backdrop').length === 0) { // Prevents multiple copies - $('
').appendTo('body'); + if (settings.showBackdrop) + { + if (!settings.useBackdropMethod2) + { + $('