Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 31, 2011 07:44 AM by benjamins1
Member
18 Points
10 Posts
Sep 13, 2008 05:39 AM|LINK
<script language="JavaScript"> function adjustDivs(){ var df=document.getElementById(''<%=UpdateProgress.ClientID %>'); dfs=df.style; dfs.position='absolute' ;
if (window.innerWidth) { dfs.left = (window.innerWidth / 2 + document.body.scrollLeft); dfs.top = (window.innerHeight / 2 + document.body.scrollTop); } else { dfs.left =(document.documentElement.offsetWidth/2 + document.body.scrollLeft); dfs.top = (document.documentElement.offsetHeight/2 + document.body.scrollTop); } } window.onload=adjustDivs; window.onresize=adjustDivs; window.onscroll=adjustDivs; </script>
This is the best i used for my projects, works both Mozilla and IE
82 Points
28 Posts
Mar 31, 2011 07:44 AM|LINK
I like this solution - looks quite simple..
but how does teh adjustDivs function fire?
I've put it all in and yet it doesn't run?
cmshafi
Member
18 Points
10 Posts
Re: Update: Here is how I positioned the UpdateProgress layer in middle of screen
Sep 13, 2008 05:39 AM|LINK
<script language="JavaScript">
function adjustDivs(){
var df=document.getElementById(''<%=UpdateProgress.ClientID %>');
dfs=df.style;
dfs.position='absolute' ;
if (window.innerWidth)
{
dfs.left = (window.innerWidth / 2 + document.body.scrollLeft);
dfs.top = (window.innerHeight / 2 + document.body.scrollTop);
}
else
{
dfs.left =(document.documentElement.offsetWidth/2 + document.body.scrollLeft);
dfs.top = (document.documentElement.offsetHeight/2 + document.body.scrollTop);
}
}
window.onload=adjustDivs;
window.onresize=adjustDivs;
window.onscroll=adjustDivs;
</script>
This is the best i used for my projects, works both Mozilla and IE
benjamins1
Member
82 Points
28 Posts
Re: Update: Here is how I positioned the UpdateProgress layer in middle of screen
Mar 31, 2011 07:44 AM|LINK
I like this solution - looks quite simple..
but how does teh adjustDivs function fire?
I've put it all in and yet it doesn't run?