Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to trick IE into using body width?

  1. #1
    Join Date
    May 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to trick IE into using body width?

    Hello,

    I finally saw my site (URL below) on IE 6 and couldn't believe my eyes. Little did I know that IE 6 doesn't seem to care much about body width. I'm a little stuck trying to fix it as I don't run IE 6 and cannot see what's going on. Plus I have no clue how to work around this bug.

    I'm forced to use a template provided by the webhost which makes matters complicated. Basically my body is supposed to be 750 px wide to keep the top table and the little footer with the copyright stuff 750 px wide and on the left. I don't have access to the top table and the copyright stuff. Also I cannot insert anything into the body before the first table or after the copyright notes. Right now they are 100% and ugly.

    Any help solving this brain teaser is highly appreciated!

    Thanks, gin
    Last edited by gingerDELUCA; 06-03-2005 at 06:31 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Hey gin,

    I was just thinking about you. I've got two new demos of the slide show up. One with no controls for IE Mac:

    http://home.comcast.net/~jscheuer1/s...lidedemo10.htm

    One with simplified controls for IE Mac:

    http://home.comcast.net/~jscheuer1/s...lidedemo14.htm

    I also fixed the bug with the captions getting messed up. I want to know if my efforts at tailoring content to IE Mac were successful and if the other browsers still like the demos.

    About your problem, it really doesn't look as bad as you might think. It is probably more that you are used to seeing it one way and got shocked seeing it the other. I am aware of most of the constraints on editing for the site and will have a detailed look now. Two questions; Would it be OK if all browsers saw all the content centered instead of left aligned? Is that something you have control over? I ask this because then it wouldn't look odd in IE and generally, centered content looks better. Also, just a note, when I reduce my IE browser window, the elements all line up centered.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    OK, I've got something. I assume you can alter the css and I know you can alter the script we worked on before. Here's what to add to the css (I'm including the current .body class as a reference, addition highlighted red, use exactly as written):
    Code:
    	.body{
    		margin-top:0px;
    		margin-right:0px;
    		margin-bottom:0px;
    		margin-left:0px;
    		width:750px;		
    	}
    
    	* html .body {
    		text-align:center;
    	}
    Then in 'our' script, add to the onload function, so it looks like this (addition highlighted red, use exactly as written):
    Code:
    function onloadfunction(){
    if (document.all&&document.getElementById&&!window.opera)
    document.getElementsByTagName('table')[0].width='750'
    if (persistmenu=="yes" && location.href!=='http://www.cafepress.com/schnickschnack'){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
    document.getElementById(cookievalue).style.display="block"
    }
    }
    What this will do is center the page in IE. All of your content will still be 750px wide. The table at the top will also become 750px wide and centered, the stuff at the bottom, over which I see no way to gain control will be centered too and is already less than 750px wide so, it will all look good. Other browsers will ignore all of this.
    Last edited by jscheuer1; 06-03-2005 at 07:40 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Good to know a new script is out! I've been meaning to asked you but didn't want to rush you. I've got to leave for an appointment with no mac access in a second but will check it tonight. I'm excited to see the new changes! Do you want me to post in the old thread?

    Now, first question, is it okay to run another script on that page without messing things up? Also I've stumbled over a fix by somebody for the top table - I'll post it tonight. It only fixes the top not the bottom. The bottom is a real pain. I've tried to make the font white and just insert the bottom myself but couldn't get the links to also go white.

    Centered is not a problem. Good thing you've suggested it especially if the stuff centers itself anyway - I didn't know! Well, I haven't seen it centered yet but it might be great. I was shooting for centered at the beginning but couldn't influence the top table behavior without left aligning it. Plus if centered there would be no worry about the bottom.

    Here's one more question: Is the "Where's My Stuff?" etc table 750 now? And is the www.SchnickSchnack.biz centered within the 750 px at the bottom. I can't see! You know how that feels ;-)

    OK. Got to run. Thanks for your help!!!

    *gin

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by gin
    Now, first question, is it okay to run another script on that page
    Um, you want to run another script? If you are just referring to my suggestion, it is not another script, it is adding to an existing script and shouldn't mess things up.

    'Where's my stuff?" was already 750px wide in IE6 here, with my modifications it still is and is centered along with all below it.

    How did you left align the top table?

    About my demos, here is as good a place as any to post about the demos, it actually fits the forum better here. Once we get IE Mac squared away, I'll probably start a thread on the slideshow in JavaScript forum which is where it really belongs.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    May 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK I'm off to start script testing in a sec. As to the center/left aligning I've tried to center it and on the mac the top bar wouldn't stop sticking to the left. I could not see where I've ever defined it to stay left. I think that was just what it started doing when I made it 750px wide and I left it get away with it. That must be the reason why it's jumping over to center on your system, it's not realy defined to be left I think.

    I'm not too crazy about the center look. Some way of keeping it left - even when you resize your window - might be nicer. I've put in the little fix I've just stumbled upon. I don't know if it works though. It's a new script and just one line of code and one line of CSS so out of lack of time I tried that first. Maybe it can be added to the script also?! Your version might be better though. And now I get it I rushed over your post - sorry - it's basically an add on to what's there already. Very neat!

    Let me concentrate on testing your stuff for right now. Though maybe you could look at my page real quick and see if something changed. The code is right after the start of the h comment. Thanks!

    *gin

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Just looked at your page,

    IE6 - Top table 750px and all is left except the two things at the bottom after 'where's my stuff', they are still centered.

    FF - Still looks just as I imagine you intend, all 750px left.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    May 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up http://home.comcast.net/~jscheuer1/side/files/johnslidedemo10.htm

    Safari OK
    Firefix OK
    Netscape OK
    IE OK no buttons as you said

    Looking really good right now! Congratulations! Anything you want me to double check on this script?

    Sorry. I'll test the other one tommorrow. I had a very long day. I just really want to test it properly and not miss something.

    *gin

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Thanks gin,

    Just wanted to mention that I checked out your script thing addition in the source code, very similar to part of what I was thinking of. If we include it in the menu script, it will apply to all pages. Also, I figured out a way to get everything left and 750px, if that is still the way you want to go. Just replace the onloadfunction in menu.js with this one:

    Code:
    function onloadfunction(){
    if (document.all&&document.getElementById&&!window.opera){
    document.getElementsByTagName('table')[0].width='750'
    var cells=document.getElementsByTagName('td')
    for (i = 0; i < cells.length; i++){
    if (cells[i].className=='footer'){
    cells[i].parentElement.parentElement.parentElement.align='left'
    cells[i].parentElement.parentElement.parentElement.width='750'
    }
    }
    var pics=document.getElementsByTagName('img')
    for (i = 0; i < pics.length; i++){
    if (pics[i].src=='http://schnickschnack.biz/e/u.png')
    pics[i].parentElement.parentElement.style.width='750px'
    }
    }
    if (persistmenu=="yes" && location.href!=='http://www.cafepress.com/schnickschnack'){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
    document.getElementById(cookievalue).style.display="block"
    }
    }
    You can remove your current 'hack' and its style.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    May 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation http://home.comcast.net/~jscheuer1/side/files/johnslidedemo14.htm

    John,

    sorry, I'm super busy again. I've just looked at the slide show and here are the results:

    SAFARI NETSCAPE FIREFOX
    -reverse button is working but stays on >> instead of going <<

    IE
    -sometimes when I click through rather fast with the step button I have to click twice to make it react

    Looking good! Let me know if you want me to check out anything in detail. I'll check the other thread to see what triggered the caption problem. I did reload etc but so far so good - everything is running smooth!

    I got to go - another appointment. I plan on inserting your script addition tonight. I'm really excited about it! Thanks!

    *gin

Bookmarks

Posting Permissions

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