Suggestion: Dynamic Positioning of UpdateProgress in center/middle of screenhttp://forums.asp.net/t/980465.aspx/1?Suggestion+Dynamic+Positioning+of+UpdateProgress+in+center+middle+of+screenThu, 31 Mar 2011 07:44:29 -04009804651252439http://forums.asp.net/p/980465/1252439.aspx/1?Suggestion+Dynamic+Positioning+of+UpdateProgress+in+center+middle+of+screenSuggestion: Dynamic Positioning of UpdateProgress in center/middle of screen <p>Hello, </p> <p>&nbsp;</p> <p>I currently have a page that is quite large, so users have to scroll to see all content.<br> On this page there are several areas where users can add/update content.<br> Because my page is so large, in respect to its length, users have to scroll down to see all content.<br> <br> Currently, the updateprogress status stays fixed on the area where it is placed. <br> It would be good if the updateprogress could position itself in the middle/center of the page/screen, nomatter where the user has scrolled.<br> The updateprogress would&nbsp;be the top layer&nbsp;of my page, only visible when something is happening.<br> <br> Currently, I have to add multiple UpdateProgress areas in order for the users to see that something is beeing updated.<br> <br> I've made a solution myself, where I've added some javscript that dynamically places the updateProgress layer in the center of the page, nomatter what the scrollposition of the page is.</p> <p>It would however, be nice to see this feature implementet as a part of atlas.</p> <p>&nbsp;</p> <p><br> &nbsp;</p> 2006-04-09T18:09:05-04:001252482http://forums.asp.net/p/980465/1252482.aspx/1?Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenUpdate: Here is how I positioned the UpdateProgress layer in middle of screen <p>For those of you who are interested, here is how I did it in order to position the updateProgress in the middle of the screen:</p> <p>&lt;script language=&quot;JavaScript&quot;&gt;</p> <p>function adjustDivs(){<br> &nbsp; var df=document.getElementById('&lt;%=UpdateProgress.ClientID %&gt;');<br> &nbsp; df.style.position='absolute'&nbsp; ;<br> &nbsp; df.style.left =document.body.offsetWidth/2 &#43; document.body.scrollLeft -150 <br> &nbsp; df.style.top = document.body.offsetHeight/2 &#43; document.body.scrollTop -50<br> &nbsp;&nbsp;&nbsp; <br> }</p> <p><br> window.onload=adjustDivs;<br> window.onresize=adjustDivs;<br> window.onscroll=adjustDivs;<br> &lt;/script&gt;</p> <p>&nbsp;</p> <p>&lt;atlas:UpdateProgress ID=&quot;UpdateProgress&quot; runat=server&nbsp;&nbsp; &gt;<br> &lt;ProgressTemplate&gt;<br> &lt;table style=&quot;border: 1px solid #000000; &quot;&nbsp; width=&quot;300&quot; height=&quot;100&quot; id=&quot;updateProgressTable&quot;&nbsp; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;<br> &nbsp;&lt;tr&gt;<br> &nbsp;&nbsp;&lt;td align=&quot;center&quot; bgcolor=&quot;#6699FF&quot;&gt;&lt;b&gt;<br> &nbsp;&nbsp;&lt;font face=&quot;Verdana&quot; color=&quot;#FFFFFF&quot;&gt;Please wait...&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;<br> &nbsp;&lt;/tr&gt;<br> &nbsp;&lt;tr&gt;<br> &nbsp;&nbsp;&lt;td align=&quot;center&quot; bgcolor=&quot;#FFFFFF&quot;&gt;<br> &nbsp;&nbsp;&lt;table border=&quot;0&quot; id=&quot;table2&quot; cellspacing=&quot;4&quot; cellpadding=&quot;3&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&lt;tr&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;img src=&quot;~/graphics/icons/spinner.gif&quot;&nbsp; runat=server/&gt;&lt;/td&gt;<br> &nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br> &nbsp;&nbsp;&lt;/table&gt;<br> &nbsp;&nbsp;&lt;/td&gt;<br> &nbsp;&lt;/tr&gt;<br> &nbsp;&lt;tr&gt;<br> &nbsp;&nbsp;&lt;td align=&quot;right&quot; valign=&quot;bottom&quot; bgcolor=&quot;#FFFFFF&quot;&gt;Close&lt;/td&gt;<br> &nbsp;&lt;/tr&gt;<br> &lt;/table&gt;<br> &lt;/ProgressTemplate&gt;<br> &lt;/atlas:UpdateProgress&gt;</p> <p>&nbsp;</p> <p>I'm no javascript guru, so I can't really guarantee that this is the best way to do it, but it works for me.</p> <p>&nbsp;</p> 2006-04-09T20:40:28-04:001313452http://forums.asp.net/p/980465/1313452.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <font color="#0000ff"> <p><font size="2">Thanks for your help treklipper.&nbsp; I have tweeked your code for my current project.&nbsp; The progress box now appears in the center of the screen even when you scroll.</font></p> </font> <p>&lt;script language=&quot;JavaScript&quot;&gt;</p> <p>function adjustDivs(){</p> <p>var df=document.getElementById('&lt;%=UpdateProgress.ClientID %&gt;');</p> <p>df.style.position='absolute' ;</p> <p>df.style.left = (document.documentElement.scrollLeft&#43;45) &#43; '%';</p> <p>df.style.top = (document.documentElement.scrollTop&#43;300) &#43; 'px';</p> <p></p> <p>}</p> <p>window.onload=adjustDivs;</p> <p>window.onresize=adjustDivs;</p> <p>window.onscroll=adjustDivs;</p> <p>&lt;/script&gt;</p> <p>&lt;atlas:UpdateProgress ID=&quot;UpdateProgress&quot; runat=server &gt;</p> <p>&lt;ProgressTemplate&gt;</p> <p>&lt;table width=&quot;200&quot; style=&quot;border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid;&quot; height=&quot;75&quot; id=&quot;updateProgressTable&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;</p> <p>&lt;tr&gt;</p> <p>&lt;td align=&quot;center&quot; bgcolor=darkblue&gt;</p> <p>&lt;b&gt;</p> <p>&lt;font face=&quot;Verdana&quot; size=2pt color=&quot;#FFFFFF&quot;&gt;&lt;asp:Label ID=lblmessage runat=server Text=&quot;Please wait...&quot;&gt;&lt;/asp:Label&gt;&lt;/font&gt;</p> <p>&lt;/b&gt;</p> <p>&lt;/td&gt;</p> <p>&lt;/tr&gt;</p> <p>&lt;tr&gt;</p> <p>&lt;td align=&quot;center&quot; bgcolor=&quot;#FFFFFF&quot;&gt;</p> <p>&lt;table border=&quot;0&quot; id=&quot;table2&quot; cellspacing=&quot;4&quot; cellpadding=&quot;3&quot;&gt;</p> <p>&lt;tr&gt;</p> <p>&lt;td&gt;&lt;img id=&quot;Img1&quot; src=&quot;~/images/icon-loading.gif&quot; runat=server/&gt;&lt;/td&gt;</p> <p>&lt;/tr&gt;</p> <p>&lt;/table&gt;</p> <p>&lt;/td&gt;</p> <p>&lt;/tr&gt;</p> <p>&lt;tr&gt;</p> <p>&lt;td align=&quot;right&quot; valign=&quot;bottom&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;/td&gt;</p> <p>&lt;/tr&gt;</p> <p>&lt;/table&gt;</p> <p>&lt;/ProgressTemplate&gt;</p> <p>&lt;/atlas:UpdateProgress&gt;</p> 2006-06-13T16:58:01-04:001319126http://forums.asp.net/p/980465/1319126.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>rather do this:</p> <p><font color="#0000ff" style="background-color:#ffffff">function</font> adjustDivs()<br> <font color="#0000ff">{</font><br> &nbsp;&nbsp;&nbsp;df=<font color="#006400" style="background-color:#ffffff">document</font>.getElementById('<font color="#a52a2a">&lt;%=UpdateProgress.ClientID %&gt;</font>');<br> &nbsp;&nbsp;&nbsp;dfs&nbsp;= df.style;<br> <br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">if</font> (<font color="#006400">window</font>.innerWidth)<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff" style="background-color:#ffffff">{</font><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.left = (<font color="#006400">window</font>.innerWidth - df.offsetWidth) / 2;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.top = (<font color="#006400">window</font>.innerHeight - df.offsetHeight) / 2;<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">}<br> </font>&nbsp;&nbsp;&nbsp;<font color="#0000ff">else<br> </font>&nbsp;&nbsp;&nbsp;<font color="#0000ff">{<br> </font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.left = (<font color="#006400">document</font>.body.offsetWidth - df.offsetWidth) / 2;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.top = (<font color="#006400">document.</font>body.offsetHeight - df.offsetHeight) / 2;<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">}<br> </font><font color="#0000ff">}</font></p> <p>Now it works on any resolution and in firefox as well...</p> 2006-06-20T08:32:37-04:001323040http://forums.asp.net/p/980465/1323040.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <blockquote><span class="icon-blockquote"></span> <h4>CSTruter</h4> <p>rather do this:</p> <p><font color="#0000ff" style="background-color:#ffffff">function</font> adjustDivs()<br> <font color="#0000ff">{</font><br> &nbsp;&nbsp;&nbsp;df=<font color="#006400" style="background-color:#ffffff">document</font>.getElementById('<font color="#a52a2a">&lt;%=UpdateProgress.ClientID %&gt;</font>');<br> &nbsp;&nbsp;&nbsp;dfs&nbsp;= df.style;<br> <br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">if</font> (<font color="#006400">window</font>.innerWidth)<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff" style="background-color:#ffffff">{</font><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.left = (<font color="#006400">window</font>.innerWidth - df.offsetWidth) / 2;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.top = (<font color="#006400">window</font>.innerHeight - df.offsetHeight) / 2;<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">}<br> </font>&nbsp;&nbsp;&nbsp;<font color="#0000ff">else<br> </font>&nbsp;&nbsp;&nbsp;<font color="#0000ff">{<br> </font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.left = (<font color="#006400">document</font>.body.offsetWidth - df.offsetWidth) / 2;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dfs.top = (<font color="#006400">document.</font>body.offsetHeight - df.offsetHeight) / 2;<br> &nbsp;&nbsp;&nbsp;<font color="#0000ff">}<br> </font><font color="#0000ff">}</font></p> <p>Now it works on any resolution and in firefox as well...</p> <p></p> </blockquote> <p></p> <p>By the looks of it this should work ok, but in my project df.offsetWidth() always comes out as 0 so the control appears too far the the right.</p> <font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">atlas</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">UpdateProgress</font><font size="2"> </font><font color="#ff0000" size="2">ID</font><font color="#0000ff" size="2">=&quot;UpdateProgress1&quot;</font><font size="2"> </font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">=&quot;server&quot;&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">ProgressTemplate</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">table</font><font size="2"> </font><font color="#ff0000" size="2">class</font><font color="#0000ff" size="2">=&quot;tblData&quot; </font><font size="2">&gt;</font><font color="#0000ff" size="2"></p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">tr</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">td</font><font size="2"> </font><font color="#ff0000" size="2">colspan</font><font color="#0000ff" size="2">=&quot;2&quot;&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">span</font><font size="2"> </font><font color="#ff0000" size="2">style</font><font color="#0000ff" size="2">=&quot;color: white&quot;&gt;&lt;</font><font color="#800000" size="2">strong</font><font color="#0000ff" size="2">&gt;</font><font size="2">Please wait while we retreive data...</font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">strong</font><font color="#0000ff" size="2">&gt;&lt;/</font><font color="#800000" size="2">span</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">td</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">tr</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">tr</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">td</font><font size="2"> </font><font color="#ff0000" size="2">colspan</font><font color="#0000ff" size="2">=&quot;2&quot;&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">asp</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">Image</font><font size="2"> </font><font color="#ff0000" size="2">ID</font><font color="#0000ff" size="2">=&quot;Image1&quot;</font><font size="2"> </font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">=&quot;server&quot;</font><font size="2"> </font><font color="#ff0000" size="2">ImageUrl</font><font color="#0000ff" size="2">=&quot;~/Images/ProgressBar4.gif&quot;</font><font size="2"> </font><font color="#0000ff" size="2">/&gt;</font><font size="2"> </p> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">td</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">tr</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">table</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">ProgressTemplate</font><font color="#0000ff" size="2">&gt;</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">atlas</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">UpdateProgress</font><font color="#0000ff" size="2">&gt;</p> </font> 2006-06-23T14:17:05-04:001324326http://forums.asp.net/p/980465/1324326.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>Kinda weird, works perfect for me, would have loved to see&nbsp;what (x)html output it actually renders which could cause this.</p> <p>Will be something small and not one of Microsoft's dodgy controls.</p> 2006-06-25T19:12:35-04:001360064http://forums.asp.net/p/980465/1360064.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>Hi,</p> <p>Thanks for all the above info.I have a problem.I want to show the UpdateProgress in middle of the grid. Just visit <a href="http://www.bluenile.com/diamond_search.asp">http://www.bluenile.com/diamond_search.asp</a>. Click on the search button.On the next page you will see the Progress bar.It is always in center of the grid.Even if I scroll the page while the updation is in progress.How can this be done.</p> <p>Thanks</p> 2006-08-03T15:50:11-04:001360971http://forums.asp.net/p/980465/1360971.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>have you looked into the AllwaysVisible control in the Atlas Control Toolkit?</p> <p>Andy.</p> <p>&nbsp;</p> 2006-08-04T09:34:30-04:001360986http://forums.asp.net/p/980465/1360986.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>hi,</p> <p>&nbsp;I have tried it.But It moves as I scroll.I do not want it to move.It should be above the grid while grid is updating.</p> 2006-08-04T10:12:08-04:001360997http://forums.asp.net/p/980465/1360997.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screenRe: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>You could get the top of the grid by doing a gridObj.offsettop() and position the panel accordingly.</p> <p>Andy.</p> <p>&nbsp;</p> 2006-08-04T10:27:43-04:002619243http://forums.asp.net/p/980465/2619243.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screen+Re: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>&lt;script language=&quot;JavaScript&quot;&gt;<br> function adjustDivs(){<br> var df=document.getElementById(''<font color="#a52a2a">&lt;%=UpdateProgress.ClientID %&gt;</font>');<br> dfs=df.style;<br> dfs.position='absolute' ;</p> <p>&nbsp;if (window.innerWidth)<br> &nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dfs.left = (window.innerWidth / 2 &#43; document.body.scrollLeft);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dfs.top = (window.innerHeight / 2 &#43; document.body.scrollTop);<br> &nbsp;&nbsp; }<br> &nbsp;&nbsp; else<br> &nbsp;&nbsp; {<br> &nbsp;dfs.left =(document.documentElement.offsetWidth/2 &#43; document.body.scrollLeft); <br> &nbsp;dfs.top = (document.documentElement.offsetHeight/2 &#43; document.body.scrollTop);<br> &nbsp;}<br> }<br> window.onload=adjustDivs;<br> window.onresize=adjustDivs;<br> window.onscroll=adjustDivs;<br> &lt;/script&gt;<br> </p> <p>This is the best i used for my projects, &nbsp;works both &nbsp;Mozilla and IE</p> 2008-09-13T05:39:31-04:004364966http://forums.asp.net/p/980465/4364966.aspx/1?Re+Update+Here+is+how+I+positioned+the+UpdateProgress+layer+in+middle+of+screen+Re: Update: Here is how I positioned the UpdateProgress layer in middle of screen <p>I like this solution - looks quite simple.. </p> <p>&nbsp;</p> <p>but how does teh adjustDivs function fire?</p> <p>I've put it all in and yet it doesn't run?</p> 2011-03-31T07:44:29-04:00