Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > dynamically resize layer height

Reply
Thread Tools

dynamically resize layer height

 
 
Teelions
Guest
Posts: n/a
 
      01-22-2007
I know that this can be done for iframes but am wondering if it can be
also done for layers.

I have 2 pages: an asp content page that has a html (toc.html) include
placed within it.

The content of toc.html is a menu list placed inside a layer called
"navcontainer". The content of the asp page is inside a layer named
"wrapper". And the include file, toc.html, is inside a layer named
"toc" inside "wrapper". So within the asp page, "navcontainer" is
inside "toc" which is inside "wrapper".

I want to dynamically resize the height of the menu list, on page load,
to whatever the height is of the "wrapper" layer on each page. Wrapper
will differ according to the amount of content on each page.

I tried the following script inside both pages but it didn't work. I
even substituted 'navcontainer' for 'toc' but still nothing. Any
suggestions?

------------------------------------------
<script type="text/JavaScript">
function tocHeight() {
if(document.getElementById) {
h = document.getElementById('wrapper').offsetHeight;
document.getElementById('navcontainer').style.heig ht = h+"px";
}
else if(document.all) {
h = document.window('wrapper').offsetHeight;
document.all.navcontainer.style.height = h+"px";
}
}
</script>

 
Reply With Quote
 
 
 
 
Jeff North
Guest
Posts: n/a
 
      01-22-2007
On 22 Jan 2007 00:58:10 -0800, in comp.lang.javascript "Teelions"
<(E-Mail Removed)>
<(E-Mail Removed). com> wrote:

>| I know that this can be done for iframes but am wondering if it can be
>| also done for layers.
>|
>| I have 2 pages: an asp content page that has a html (toc.html) include
>| placed within it.
>|
>| The content of toc.html is a menu list placed inside a layer called
>| "navcontainer". The content of the asp page is inside a layer named
>| "wrapper". And the include file, toc.html, is inside a layer named
>| "toc" inside "wrapper". So within the asp page, "navcontainer" is
>| inside "toc" which is inside "wrapper".
>|
>| I want to dynamically resize the height of the menu list, on page load,
>| to whatever the height is of the "wrapper" layer on each page. Wrapper
>| will differ according to the amount of content on each page.
>|
>| I tried the following script inside both pages but it didn't work. I
>| even substituted 'navcontainer' for 'toc' but still nothing. Any
>| suggestions?
>|
>| ------------------------------------------
>| <script type="text/JavaScript">
>| function tocHeight() {
>| if(document.getElementById) {
>| h = document.getElementById('wrapper').offsetHeight;
>| document.getElementById('navcontainer').style.heig ht = h+"px";
>| }
>| else if(document.all) {
>| h = document.window('wrapper').offsetHeight;
>| document.all.navcontainer.style.height = h+"px";
>| }
>| }
>| </script>


First off, have you the height defined in an in-line style or css
file/section? I've noticed that nothing works if it isn't defined.

Secondly, why use javascript when css can handle this quite easily.
http://css.maxdesign.com.au/floatuto...torial0816.htm
---------------------------------------------------------------
http://www.velocityreviews.com/forums/(E-Mail Removed) : Remove your pants to reply
---------------------------------------------------------------
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A way to dynamically resize the datagrid's frame height? kingflux ASP .Net Datagrid Control 0 04-07-2007 07:30 PM
business layer, data access layer , presentation layer for asp.net using C#.net Dhananjay ASP .Net 1 12-18-2006 11:35 PM
How to resize all images sizes and coordinates of the images on resize browser rams.kakara@gmail.com ASP General 2 02-13-2005 09:03 AM
bridge / layer 2 switch / layer 3 switch Joel M. Baldwin Cisco 2 11-06-2003 11:19 PM
difference b/w layer 2 switch and layer 3 switch praveen Cisco 1 10-22-2003 07:19 AM



Advertisments