|
function setViewportDimensions(hiddenFieldID)
{
var field = document.getElementById(hiddenFieldID);
var width;
var height;
// see http://evolt.org/node/30655
if (window.innerWidth)
{
width = window.innerWidth;
height = window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth)
{
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
}
else if (document.body)
{
width = document.body.clientWidth;
height = document.body.clientHeight;
}
field.value = width + "," + height;
}
var thumbnailDivs = {};
function registerThumbnailDiv(thumbnailDivId)
{
thumbnailDivs[thumbnailDivId] = document.getElementById(thumbnailDivId);
thumbnailDivs[thumbnailDivId].style.visibility = "hidden";
}
function hideThumbnailDivs()
{
for(var divId in thumbnailDivs)
{
thumbnailDivs[divId].style.visibility = "hidden";
}
document.onclick = null;
}
function showThumbnailDiv(thumbnailDivId)
{
hideThumbnailDivs();
thumbnailDivs[thumbnailDivId].style.visibility = "";
window.setTimeout("document.onclick = hideThumbnailDivs", 300);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Tom Crane is a software developer from London. He likes to code in C# but has been known to implement Java-based content management systems for public sector clients.
Most of the time he does web programming and tries to make complex tasks seem easy through friendly UI.