सभी सुझावों के लिए धन्यवाद! ऐसा लगता है कि बदसूरत चीजें मुझे जरूरी थीं। आईई और फ़ायरफ़ॉक्स में निम्नलिखित कार्य (मेरी मशीन पर, वैसे भी)। मैं CodeProject.com के लिए इस से बाहर एक लेख बना सकता है बाद में ;-)
यह जावास्क्रिप्ट < सिर > अनुभाग में होता है:
<script type="text/javascript">
var tmout = null;
var mustReload = false;
function Resizing()
{
if (tmout != null)
{
clearTimeout(tmout);
}
tmout = setTimeout(RefreshAll,300);
}
function Reload()
{
document.location.href = document.location.href;
}
//IE fires the window's onresize event when the client area
//expands or contracts, which causes an infinite loop.
//the way around this is a hidden div set to 100% of
//height and width, with a guard around the resize event
//handler to see if the _window_ size really changed
var windowHeight;
var windowWidth;
window.onresize = null;
window.onresize = function()
{
var backdropDiv = document.getElementById("divBackdrop");
if (windowHeight != backdropDiv.offsetHeight ||
windowWidth != backdropDiv.offsetWidth)
{
//if screen is shrinking, must reload to get correct sizes
if (windowHeight != backdropDiv.offsetHeight ||
windowWidth != backdropDiv.offsetWidth)
{
mustReload = true;
}
else
{
mustReload = mustReload || false;
}
windowHeight = backdropDiv.offsetHeight;
windowWidth = backdropDiv.offsetWidth;
Resizing();
}
}
</script>
< शरीर > इस तरह शुरू होता है:
<body onload="RefreshAll();">
<div id="divBackdrop"
style="width:100%; clear:both; height: 100%; margin: 0;
padding: 0; position:absolute; top:0px; left:0px;
visibility:hidden; z-index:0;">
</div>
डीआईवी लेआउट के लिए बाईं ओर तैरता है। मुझे डीवीवी की सीमाओं के कारण फ्लोट को लपेटने से रोकने के लिए ऊंचाई और चौड़ाई को प्रतिशत तक केवल शर्मीली (उदाहरण के लिए, 99.99%, 59.99%, 3 9.99%) निर्धारित करना पड़ा।
अंत में, सामग्री अनुभाग के बाद, एक और जावास्क्रिप्ट ब्लॉक ताज़ा प्रबंधन करने के लिए:
var isWorking = false;
var currentEntity = <%=currentEntityId %>;
//try to detect a bad back-button usage;
//if the current entity id does not match the querystring
//parameter entityid=###
if (location.search != null && location.search.indexOf("&entityid=") > 0)
{
var urlId = location.search.substring(
location.search.indexOf("&entityid=")+10);
if (urlId.indexOf("&") > 0)
{
urlId = urlId.substring(0,urlId.indexOf("&"));
}
if (currentEntity != urlId)
{
mustReload = true;
}
}
//a friendly please wait... hidden div
var pleaseWaitDiv = document.getElementById("divPleaseWait");
//an example content div being refreshed via AJAX PRO
var contentDiv = document.getElementById("contentDiv");
//synchronous refresh of content
function RefreshAll()
{
if (isWorking) { return; } //no infinite recursion please!
isWorking = true;
pleaseWaitDiv.style.visibility = "visible";
if (mustReload)
{
Reload();
}
else
{
contentDiv.innerHTML = NAMESPACE.REFRESH_METHOD(
(currentEntity, contentDiv.offsetWidth,
contentDiv.offsetHeight).value;
}
pleaseWaitDiv.style.visibility = "hidden";
isWorking = false;
if (tmout != null)
{
clearTimeout(tmout);
}
}
var tmout2 = null;
var refreshInterval = 60000;
//periodic synchronous refresh of all content
function Refreshing()
{
RefreshAll();
if (tmout2 != null)
{
clearTimeout(tmout2);
tmout2 = setTimeout(Refreshing,refreshInterval);
}
}
//start periodic refresh of content
tmout2 = setTimeout(Refreshing,refreshInterval);
//clean up
window.onunload = function()
{
isWorking = true;
if (tmout != null)
{
clearTimeout(tmout);
tmout = null;
}
if (tmout2 != null)
{
clearTimeout(tmout2);
tmout2 = null;
}
बदसूरत है, लेकिन यह काम करता है - जो मैं इसे लगता है कि क्या वास्तव में मायने रखती ;-)
स्रोत
2008-10-08 03:23:17
आप किस तरह से "पैमाने" का मतलब है? क्या आप फिट करने के लिए लेआउट खिंचाव बनाने के बारे में बात कर रहे हैं, या क्या आप फ़ॉन्ट आकार/छवि आयामों को भी बढ़ाने का मतलब रखते हैं? – nickf
दोनों - लेआउट हमेशा स्क्रीन भरना चाहिए, और फ़ॉन्ट आकार को आनुपातिक और केंद्रित क्षैतिज और लंबवत रहने के लिए बढ़ाना चाहिए या लंबवत –