Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions jquery.interstitial.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
z-index: 1000001;
}

#iframe
{
width: 100%;
height: 100%;
border: none;
outline: none;
position: absolute;
top: 0;
left: 0;
}

/*--Making IE6 Understand Fixed Positioning--*/
*html #fade {
position: absolute;
Expand Down
44 changes: 28 additions & 16 deletions jquery.interstitial.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'width' : 600,
'height' : 400,
'opacity' : 70,
'isiFrame' : false,
'id' : 'popupBlock',
'onInterstitialClose' : function(){}
};
Expand All @@ -39,24 +40,35 @@

//Fade in the Popup
$('body').append('<div id="' + settings.id + '"></div>');
$('#' + settings.id).load(settings.url, function() {
$('#' + settings.id).css({'width' : Number(settings.width), 'height' : Number(settings.height)}).fadeIn();
});

//Define margin for center alignment (vertical + horizontal)
var popMargTop = settings.height / 2;
var popMargLeft = settings.width / 2;

//Apply Margin to Popup
$('#' + settings.id).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
if (settings.isiFrame) {

$('<iframe />'); // Create an iframe element
$('<iframe />', {
name: 'frame',
id: 'iframe',
src: settings.url,
}).appendTo('#' + settings.id);
$('#' + settings.id).fadeIn();
} else {
$('#' + settings.id).load(settings.url, function () {
$('#' + settings.id).css({'width': Number(settings.width), 'height': Number(settings.height)}).fadeIn();
});

//Define margin for center alignment (vertical + horizontal)
var popMargTop = window.height / 2;
var popMargLeft = window.width / 2;

//Apply Margin to Popup
$('#' + settings.id).css({
'margin-top': -popMargTop,
'margin-left': -popMargLeft
});
}

//On click of the fade, close the popup and fade
$('#fade').live('click', function() {
//On click of the fade, close the popup and fade
$('#fade').live('click', function() {
$().interstitial('close', settings);
});
});

},

Expand Down