Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto-Resize Div.

    I'm a member on the following site: http://www.coltsgeeks.com, and following discussions with the site owner we've discovered an issue in Windows XP Firefox . When on the message board threads:

    http://coltsgeeks.com/forum_posts.asp?TID=29&PN=6

    You may have to click through a few pages to find the problem, it randomly happens.

    Javascript is here: (bottom of page source)

    Code:
    <script type="text/javascript">
    	//division containing the content- transparent background
    	var contentHeight2 = document.getElementById("holder1").offsetHeight;
    	//White Background = cbc
    	var cbc = document.getElementById("cntBak_cnt"); 
    	//Black Background
    	var cb = document.getElementById("cntBak"); 
    	//Page background Image
    	var pg = document.getElementById("page_content");
    	// bottom left box of stats
    	var sb = document.getElementById("statBak");
    	//set white background Content + 10
    	cbc.style.height = parseInt(contentHeight2)+10+"px";
    	//set white background Content + 73
    	cb.style.height = parseInt(contentHeight2)+73+"px";
    	//set background Image = content + 73
    	pg.style.height = parseInt(contentHeight2)+300+"px";
    	//pg.style.height = parseInt(cb.style.height)+227+"px"
    
    	//extend background image div if page content is greater than 700
    	if (parseInt(contentHeight2)-300 > 700){
    		//pg.style.height = parseInt(contentHeight2)+300+"px";
    		var cb1 = document.getElementById("cntBak").offsetHeight;
    		var cb2 = document.getElementById("cntBak").offsetTop;
    		pg.style.height = (parseInt(cb1)+parseInt(cb2)+100)+"px";
    
    	}
    
    	//set minimum heights on Black & white backgrounds
    	if (parseInt(cb.style.height) < 442){
    		cb.style.height = 442+"px";
    		cbc.style.height = 379+"px";
    		var cb3 = document.getElementById("cntBak").offsetHeight;
    		var cb4 = document.getElementById("cntBak").offsetTop;
    		pg.style.height = (parseInt(cb3)+parseInt(cb4)+100)+"px";
    		//pg.style.height = parseInt(contentHeight2)+300+"px";
    	}
    </script>
    I know the page does not validate, and frankly there is nothing I can do about this. I'd appreciate your help in this thorny problem, if you suspect a specific problem in the validation that may be causing the problem then thats fine, if you just say validate the page, I'm not sure I can convince the owner to do so.

    Thanks in advance.

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone have any ideas as to how I can fix this baby up.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Maybe you should tell us exactly what the problem is rather than just saying there is a problem.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My bad, I thougtht I had included a description in the orginal post.

    At times the white slides off the bottom and moves over the gray area and the background picture.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I'm a little confused as to why you need the resize script in the first place. Why not just let the div expand with the content? Who coded the forum? The absolute positioning seems to be the gist of your problem.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    But removing the height's from the CSS in the <div>'s we are talking about, the content still runs over the edges. How would that be rectified.

    I see your point - but now we are almost getting into a CSS issue here. Because by disabling JS you'd have the same problem.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I see that which means there is a height set somewhere in the CSS preventing the containing divs from sizing to the content. #cntBak has a set height of 600px, #cntBak_cnt has a set height of 538px. If you are able to wrap #cntBak_cnt around the content and then wrap #cntBak around #cntBak_cnt you shouldn't need the JS of course you would need to remove the heights from those divs.
    Last edited by _Aerospace_Eng_; 08-16-2006 at 10:02 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looks like its time to scour the code. Fun! Especially, when you didn't build the site. hehe.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •