help: repositioning items in a user control using Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Helmick

    help: repositioning items in a user control using Javascript

    This one has me really stumped, so I thought I'd ask publicly.

    I was trying to take my ASP.NET web page "template" -- banner graphic, small
    navigation bar, and user feedback message area -- and make it into a user
    control. I wanted to stretch one of the graphics so it always went all the way
    across the browser window. So far, so good... And then, I wanted to take the
    two-cell table that holds the naviagation bar and make it always appear on the
    far right of the browser window. That didn't work. No matter what I've tried,
    it always appears where the initial "style" positioning info says it should.

    Can someone help me get this right?

    Here is the source for the user control:

    <%@ Control Language="vb" AutoEventWireup ="false"
    Codebehind="uc_ Banner1.ascx.vb " Inherits="ADvie w2.uc_Banner1"
    TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

    <script type="text/javascript" language="JavaS cript">
    <!--
    function resizeStuff() {
    var browser_width;
    browser_width = document.body.c lientWidth;
    document.getEle mentById('imgCo lorBar').width= browser_width;

    document.getEle mentById('navba r').left=browse r_width-document.getEle mentById('navba r').width;
    debugger;
    }
    -->
    </script>

    <LINK href="ADview2St yles.css" type="text/css" rel="stylesheet ">
    <asp:imagebutto n id="imgLogo" style="DISPLAY: inline; LEFT: 6px; POSITION:
    absolute; TOP: 0px" ImageUrl="image s\logo_small.pn g"
    Height="39" Width="81" Runat="server"> </asp:imagebutton >
    <!---->
    <asp:label id="stPageTitle " style="DISPLAY: inline; LEFT: 102px; POSITION:
    absolute; TOP: 4px"
    Height="32" Width="499px" Runat="server" CssClass="paget itle" >PAGE
    TITLE</asp:label>
    <!---->
    <IMG id="imgColorBar " alt="" src="images\img ColorBar.png" style="DISPLAY:
    inline; LEFT: 6px; POSITION: absolute; TOP: 40px"
    Height="20" Width="752">
    <!---->
    <asp:label id="stInstructi ons" style="DISPLAY: inline; LEFT: 6px; POSITION:
    absolute; TOP: 64px"
    Runat="server" CssClass="stepd escription" Height="64" Width="750">
    The quick brown fox jumped over the lazy dogs.
    </asp:label>
    <!---->
    <table id='navbar' style="DISPLAY: inline; LEFT: 650px; POSITION: absolute; TOP:
    2px" cellSpacing="0" cellPadding="0" width="78" height="33" border="0">
    <tr>
    <td><a href="frmHome.a spx"
    onmouseover="MM _swapImage('but ton_home','','h ttp://localhost/adview2/toolbar/button_home_f2. gif',1);"
    onmouseout="MM_ swapImgRestore( );" ><img name="button_ho me" alt="home"
    src="http://localhost/adview2/toolbar/button_home.gif " width="34" height="33"
    border="0"></A></td>
    <td><a href="frmCheckl ist.aspx"
    onMouseOver="MM _swapImage('but ton_checklist', '','http://localhost/adview2/toolbar/button_checklis t_f2.gif',1);"
    onMouseOut="MM_ swapImgRestore( );" ><img name="button_ch ecklist" alt="checklist"
    src="http://localhost/adview2/toolbar/button_checklis t.gif" width="37"
    height="32" border="0"></a></td>
    </tr>
    </table>

    <script type="text/javascript" language="JavaS cript">

    <!--
    window.onload=r esizeStuff;
    window.onresize =resizeStuff;
    -->
    </script>

Working...