ifame 스크롤 막대 제거

2930 단어 firefoxSafari

	function changeframe()
	{			
	  var workspace = document.getElementById('workspace');
		var navigator = getOs();
// 。
    (document.documentElement && document.documentElement.scrollTop)?document.documentElement.scrollTop=0 : document.body.scrollTop=0;    
		if("Firefox" == navigator)
		{
		  alert(workspace.height);
		  alert(workspace.width);
			workspace.height=window.frames["workspace"].document.body.scrollHeight;
			workspace.width=window.frames["workspace"].document.body.scrollWidth;
		  alert(workspace.height);
		  alert(workspace.width);			
		}
		else
		{
		  // alert(workspace.style.height);
		  // alert(workspace.style.width);		
		  		  		  
		  //alert('window.frames[workspace].document.body.scrollTop'+window.frames["workspace"].document.body.scrollTop);
		  alert('window.frames[workspace].document.body.scrollHeight'+window.frames['workspace'].document.body.scrollHeight);
		  alert('workspace.document.body.scrollHeight'+workspace.document.body.scrollHeight);
		  var height = window.frames['workspace'].document.body.scrollHeight;
		  // allPrpos(document.getElementById('content-container').style);
		  document.getElementById('regionB').style.height = height+100;
		  // allPrpos(document.getElementById('regionB').style);
			workspace.style.height = height;		
			workspace.style.width=window.frames['workspace'].document.body.scrollWidth;
			// allPrpos(workspace.style);
			document.documentElement.scrollTop = 0;
		  alert(workspace.style.height);
		  alert(workspace.style.width);		      		
		}	
	}

function allPrpos(obj) {  
    var props = ""; 
    for(var p in obj){  
        if(typeof(obj[p])=="function"){  
            obj[p](); 
        }else{  
            props+= p + "=" + obj[p] + "\t"; 
        }  
    }  
    alert(props); 
}	

function getOs()
{
    var OsObject = "";
   if(navigator.userAgent.indexOf("MSIE")>0) {
        return "MSIE";
   }
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
        return "Firefox";
   }
   if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
        return "Safari";
   } 
   if(isCamino=navigator.userAgent.indexOf("Camino")>0){
        return "Camino";
   }
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
        return "Gecko";
   }  
}

그런데 만약에 iframe에 iframe를 끼우면 어떡하지?첨부 파일 보기

좋은 웹페이지 즐겨찾기