IE problem with JavaScript, ActiveX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Baversjo
    New Member
    • Jan 2008
    • 1

    IE problem with JavaScript, ActiveX

    I am having a problem with some simple Javascript code on a project im on. In internet explorer 7 some ActiveX controller blocks my code, is there any way around that? Is there something in my code that Internet explorer doesn't like?

    The Javascript is supposed to rezise a main div, it works fine in most browsers but i would love to in some way get around that IE7 warning.

    Here is the code (function size loaded by body onresize):

    Code:
    function size(){
    				var offset = 140;
    				
    				if(window.innerHeight == null){ //IE
    					var height = document.documentElement.offsetHeight - offset;
    					height += "px";
    					document.getElementById("main-cont").style.height = height;
    				}
    				else{ // Rest of the browsers
    					var height = window.innerHeight - offset;
    					height += "px";
    					document.getElementById("main-cont").style.height = height;
    				}
    
    			}
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TSDN!

    I think what you want is clientHeight. See this link.

    Comment

    Working...