Skip to content

Instantly share code, notes, and snippets.

@pykotechguy
Created May 28, 2014 00:34
Show Gist options
  • Save pykotechguy/f42ab52aa87ec4139568 to your computer and use it in GitHub Desktop.
Save pykotechguy/f42ab52aa87ec4139568 to your computer and use it in GitHub Desktop.
Simple Modal
function GetWidth()
{
var x = 0;
if (self.innerHeight) {
x = self.innerWidth;
} else if (document.documentElement && document.documentElement.clientHeight){
x = document.documentElement.clientWidth;
} else if (document.body){
x = document.body.clientWidth;
}
return x;
}
function GetHeight()
{
var y = 0;
if (self.innerHeight) {
y = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
y = document.documentElement.clientHeight;
} else if (document.body){
y = document.body.clientHeight;
}
return y;
}
// x - width
// y - length/height
function showModal(x, y, dataHtml) {
$("div#Modal").show().height(y).width(x).html(dataHtml);
}
function hideModal(modalId) {
$(modalId).hide('slow');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment