Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2005, 08:28 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default JavaScript detect screen resolution

I have the <div> which is positioned with the style tag shown (demo):
Is there any way that i can have the div automatically attached to the bottom of the browser and centered for each resolution.

Is there a way this can be done, can JS not detect screen-resolution?

Code:
<style>
.demo {color:#000000; border-color:#666666; background-color:#FFCC00; font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:bold;
layer-background-color:#cccccc; position:absolute; left:20%; bottom:0px; width:100%; height:100px; visibility:hidden; z-index:5; border-color:#FFFFFF; border:inherit;}
</style>

<div id="booking_details" class="demo" style="visibility:hidden">
<%
sTaxOutput_inf = formatnumber(sTaxOutput*33)/100
set rscontract = con.execute("SELECT id,contract_code,contract_title,airline FROM `net_contract` WHERE id = '" & contractId & "'")
'response.Write "SELECT id,contract_code,contract_title,airline FROM `net_contract` WHERE id = '" & contractId & "'<br>"

tempStr = ""
set rsairname = con.execute("SELECT AirlineName FROM `dbo_tp_airline` WHERE AirlineCode = '" & UCase(rscontract("airline")) & "'")
if (not rsairname.EOF) then
tempStr = trim(rsairname("AirlineName"))
end if
rsairname.Close
set rsairname = Nothing

%>

<table id="demodiv_t_Main" border="1" bordercolor="<%=brdColDark%>" width="100%" height="100" summary="The Booking Details for the journey - Outward and In ward flights">


<tr>
    <td colspan="2">
    <table id="bookings_heading">
        <tr bordercolor="<%=headCol%>" bgcolor="<%=yelCol%>">
            <td nowrap class="head2Fnt">ID: <%=trim(rscontract("id"))%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td nowrap class="head2Fnt">Airline: <%=tempStr%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td nowrap class="head2Fnt">Code: <%=trim(rscontract("contract_code"))%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td nowrap class="head2Fnt">Title: <%=trim(rscontract("contract_title"))%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
    </table>    
    </td>
</tr>

<tr>
    <td width="50%" valign="top">
    <table id="bookings" class="demo_t" width="100%">
        <tr bordercolor="<%=yelCol%>" bgcolor="<%=yelCol%>">
            <td class="head2Fnt">Your booking Details:</td>
          </tr>  
          <tr>
            <td class="font4" bordercolor="#FFFFFF">
              <b>Departing:</b> 
            <input type="text" class="font4" name="OutDispDate" value="" STYLE="text-align:right; background-color:<%=yelCol%>; border-width:0;" readonly />
            <input type="text" class="font4" name="OutDispClass" value="" STYLE="background-color:<%=yelCol%>; border-width:0;" readonly />
            </td>
        </tr>
          <tr>    
            <td class="font4" bordercolor="#FFFFFF">
      <%
      '... if the Journey is a 'One-Way' then DO NOT show the 'Returning Leg details'
      if (oneWay) then
      response.Write "&nbsp;"
      else
      %>
      <b>Returning:</b> 
            <input type="text" class="font4" name="InDispDate" value="" STYLE="text-align:right; background-color:<%=yelCol%>; border-width:0;" readonly />
            <input type="text" class="font4" name="InDispClass" value="" STYLE="background-color:<%=yelCol%>; border-width:0;" readonly />
      <% end if %>
            </td>
        </tr>
    </table>                
    </td>
    <td width="50%" align="right">
    <table class="demo_t" border="0" bordercolor="#000000"> 
        <tr>
            <td class="font4" bordercolor="#FFFFFF" align="right" nowrap>
            <b><%=noa%> x Adult Fare of</b>
            </td>
            <td align="right">
            <input type="text" class="font4" name="AdtDispCost" STYLE="text-align:right; background-color:<%=yelCol%>; border-width:0;" readonly size="10">
            </td>
            <td><b>plus Est. Tax</b> 
            </td>
            <td>
            <input type="text" class="font4" name="AdtDispCost_tax" STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly  size="10"/>
            </td>
        </tr>        
        <% if CInt(noc) <> 0 then %>
        <tr>
            <td class="font4" bordercolor="#FFFFFF" align="right">
            <b><%=noc%> x Child Fare of</b>
            </td>
            <td align="right">
            <input type="text" class="font4" name="ChdDispCost" STYLE="text-align:right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
            </td>
            <td><b>plus Est. Tax </b>
            </td>
            <td>
            <input type="text" class="font4" name="ChdDispCost_tax" STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
            </td>
        </tr>    
        <% end if %>
        <% if CInt(noi) <> 0 then %>
        <tr>
            <td class="font4" bordercolor="#FFFFFF" align="right">
                <b><%=noi%> x Infant Fare of</b> 
              </td>
            <td align="right">
            <input type="text" class="font4" name="InfDispCost" STYLE="text-align:right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
            </td>
              <td>
                <b>plus Est. Tax</b>
                </td>
                <td>
                 <input type="text" class="font4" name="InfDispCost_tax" value="<%=formatnumber(sTaxOutput_inf,2)%>"
                STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
              </td>
        </tr>
          <% end if %>
        <!--
        <tr>
            <td align="right" class="font4" bordercolor="#FFFFFF">
            <b>&nbsp;&nbsp;Total Fare</b> 
            </td>
            <td>
        -->

            <input type="hidden" class="font4" name="DispCost" value="0.00" STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
        <!--
            </td>            
            <td align="right" class="font4" bordercolor="#FFFFFF" align="right">
            <b>plus Est. Tax </b>             
        -->
            <input type="hidden" class="font4" name="EstTaxDispCost" value="0.00" STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
        <!--
        </td>
        </tr>
        -->
        <tr>            
        <td colspan="2">&nbsp;</td>
        <td class="font4" align="right">
        <b>Grand Total</b>
        </td>
        <td class="font4" align="right">
        <input type="text" class="font4" name="GrandTotal" value="0.00" STYLE="text-align: right; background-color:<%=yelCol%>; border-width:0;" readonly size="10"/>
        </td>
        </tr>
    </table>
    </td>
</tr>
<tr bordercolor="<%=yelCol%>">
<td colspan="2" align="center">
<input type="button" onClick="javascript: return chk_frm('<%=combCl%>');" class="font2" onMouseOver='style.cursor="hand"' value="&nbsp;Submit&nbsp;" /> 
</td>
</tr>    
</table>

</div>

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old September 19th, 2005, 06:07 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Crmpicco!!!
 Try this
http://www.dynamicdrive.com/dynamici...window_dev.htm
Hope this will help you

Cheers :)

vinod
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Resolution ajeesh_online C# 1 June 14th, 2006 12:37 AM
Detect Resolution anshul Pro PHP 3 April 7th, 2004 05:16 PM
screen resolution mistry_bhavin Pro VB.NET 2002/2003 0 March 13th, 2004 02:36 PM
How to detect screen resolution pb_user Classic ASP Basics 1 August 24th, 2003 01:52 AM



All times are GMT -4. The time now is 05:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.