SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Bizarre IE6 Bug

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bizarre IE6 Bug

    I've been stuck on this for weeks now and can't seem to find anyone who knows how to work around the problem I have.

    This site works in IE5.5/Win, Mozilla 1.0, and IE5/Mac. However, I get a Javascript error in IE6/Win.

    After some work, I've found the error occurs in the .js file con_size.js on the following line:

    el.style.height = String(getClientHeight() + wdAdj + 'px');
    It generates an "invalid argument" error, which I found odd since IE6 doesn't seem to have a problem with the nearly identical previous line:

    el.style.width = String(getClientWidth() + htAdj + 'px');
    Removing the line that generates the error gets rid of the Javascript error. Curiously, removing anything related to ypSimpleScrollC.js also gets rid of the Javascript error.

    Does anyone know what's going on, and have a work-around for this? I've also created an alternate version of the page with all Javascript inline, to assist in debugging.

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change your con_size.js to this
    Code:
    function getElement(id) {
    	return (document.getElementById || document.all)(id);
    	}
    
    function getClientWidth() {
    	var w = (document.all) ? document.body.clientWidth : window.innerWidth;
    	return parseInt(w);
    	}
    
    function getClientHeight() {
    	var h = (document.all) ? document.body.clientHeight : window.innerHeight;
    	return parseInt(h);
    	}
    	
    function sizeToClient(id, wdAdj, htAdj) {
    	var el = getElement(id);
    	if (el && el.style) {
    		el.style.width = (getClientWidth() + wdAdj) + 'px';
    		el.style.height = (getClientHeigh() + htAdj) + 'px';
    		}
    	}
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Member
    Join Date
    May 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well...tried that. Didn't work. DID notice something peculiar, though.

    IE6 works properly as long as the parameters passed to the sizeToClient function are NEGATIVE. All other browsers require POSITIVE values. Is there any way to modify the code you sent me so that the values IE6 gets are negative?


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
  •