Created
May 28, 2014 00:34
-
-
Save pykotechguy/f42ab52aa87ec4139568 to your computer and use it in GitHub Desktop.
Simple Modal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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