Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Javascript / 100% heightJavascript / 100% height
Previous
 
Next
New Post
11/25/2008 2:33 AM
 

Basically my goal here is to get a nice skin using 100% of the browser window with the footer stuck to the bottom.

I've got footerstickalt working pretty well to get just this effect. I start running into problems like if I want to put a background image on my contentpane, it won't repeat down to the bottom of the page. its either make a page background image or sort something out using background-color's only, something I don't want to do.

So I got to looking to using javascript to resize my contentarea of the skin (ie everything but header and footer) I put some code in <body onload="script.js> in a regular html file and it works quite well, gets the browser height, minuses the header and footer height, and resizes the content area to that.

So I tried to do this in DNN - using the onload in body is out, but its easy enough to add javascript into the head of pages etc which I have done fine. so my page is loading javascript no problem.

the problem is firing that javascript on the window.onload event. My code will display alert messages when the page is loaded, but it just will not resize my <div> I even put the same javascript functions in a button and clicked it - the effect is that it will resize my content div for a split second before it magically resizes back to what it was - I assume this is DNN's doing somehow?

the basic javascript being run is:

function alertSize() {
  window. Height = ' + myHeight ); //its calculating myheight just fine - the alert displays
  var el = document.getElementById("content");
  el.style.height = (myHeight-130) + 'px';
}

Method I tried to use to run it on pageload:

if (window.addEventListener){
  window.addEventListener("load", alertSize(), false);
} else if (window.attachEvent){
  window.attachEvent ("onload", alertSize())
}

or plain old:

  window.onload 

anyone had any success getting something like this to work? I'd be happy to abandon javascript altogether...

 
New Post
11/25/2008 8:51 AM
 

Hi Chris,

    Your problem here is browser support for the hieght attribute. There is a full treatment of the problem (with a tested solution) here http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/109/threadid/244389/scope/posts/threadpage/3/Default.aspx .

This is well tested and you can see some of the problems connected with the hieght attribute in the discussion thread.

One note about IE 6 support (or lack of) is that repeating background graphics will not work in the 'relative/absolute' positioning context. Javascript can fix this.
The difficulty lays in the fact that any use of height:100% requires that the DOM has correctly calculated the real (pix value) height of the containing element.
In IE6 you must have a real pix value set on this containing element before effects such as 'repeat' will work. So to get this to work you can use Javascript to traverse the DOM and calculate the correct height value and set accordingly.

Hope this helps

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Javascript / 100% heightJavascript / 100% height


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out