Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen size

Status
Not open for further replies.

dcushnie

Programmer
Feb 2, 2005
28
CA
I have a web page where I have a header and a footer that are to stay on the top and bottom of the page at all times.
I want only the middle section of the page to scroll verticlly. The middle section of the page is a form and the footer contains the submit and reset buttons. I am not using frames on this page because i don't know how to submit a form from a different frame also i don't really like frames. I am using the overflow attribute on a div tag to make the middle section scroll right now. But i need a way to set its size depending on the users screen size. I know in javascript that screen.height will get me the screen size but i can't figure out how to get it into this line of code.
Can anyone help this struggling programming?
 
can you 'include' some javascript into your vbscript file? i posted something on how to do this last week i think, serach for UTC
 
Ok that got the screen height into my VBScript
but now how do i get that into my div tag???

this is the javascript (i subtract 300 to account for the size of the header and footer)

function getHeight(){
return screen.height-300;
}

this is what i tried on the div tag and it isn't working

<div style="width:100%; height<% = Response.Write getHeight() %>; overflow: auto;">

 
Maybe this will point you into the right direction...

Code:
<html>
<head>
<SCRIPT LANGUAGE=javascript>
function onPageLoad(){
document.getElementById("sw").value = screen.width;
document.getElementById("sh").value = screen.height;
document.getElementById("asw").value = window.screen.availWidth;
document.getElementById("ash").value = window.screen.availHeight;
document.getElementById("myform").submit();
}
</SCRIPT>
</head>
<BODY onload="Javascript:onPageLoad();">
<form id="myform" name="myform" method="post" action="default.asp">
<input type="hidden" name="sw" id="sw"/>
<input type="hidden" name="sh" id="sh"/>
<input type="hidden" name="asw" id="asw"/>
<input type="hidden" name="ash" id="ash"/>
</form>
</body>
</html>
 
thanks for trying but that direction didn't help me
i just need to get my function call into that div tag on the height attribute
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top