아이프레임 스크롤바 안생기게 하는 것 좀 알려주세요.

아이프레임 스크롤바 안생기게 하는 것 좀 알려주세요.

QA

아이프레임 스크롤바 안생기게 하는 것 좀 알려주세요.

본문

co.kr 주소와 ac.kr 주소 두개가 있습니다.

 

사정이 생겨서 ac.kr을 아이프레임으로 불러 오고 있습니다.

 

익스에서는 아이프레임이 안생기는데

크롬에서는 아이프레임이 생깁니다.

 

ac.kr에

auto_size.html 파일을 만들어서

<code>

<html>
  <head>
    <title>Resizing Page</title>
    <script type="text/javascript">
      function onLoad() {
        var params = window.location.search.substring( 1 ).split( '&' );
        var height;
        for( var i = 0, l = params.length; i < l; ++i ) {
          var parts = params[i].split( '=' );
          switch( parts[0] ) {
          case 'height':
            height = parseInt( parts[1] );
            break;
          }
        }
        if( typeof( height ) == 'number' ) {
          window.top.updateIFrame( height );
        }
      }

    window.onload = onLoad;
    </script>
  </head>
  <body>
    <p>Resizing IFrame...</p>
  </body>
</html>

</code>

 

index.html에는

<code>

<script type="text/javascript">
      function updateIFrame( height ) {
        var iframe = document.getElementById( 'myiframe' );
        iframe.setAttribute( '+ 'height', height );
      }
</script>
<iframe id="myiframe" src="http://.co.kr/index.php" scrolling="yes" frameborder="0" width="100%" height="100%"></iframe>

</code>

 

이렇게 한다음에.

 

co.kr에

<code>

<style>
.rolling-td iframe{    
border:0;
    margin:0;
    padding:0;
    margin-right:0px;
    width:132px;
    height:150px;
    overflow:hidden;
}
.rolling-td {
    width:137px;
}
.rolling-td p{padding:0;margin:0;}
</style>

</code>

 

이런식으로 하고 있습니다.

 

조언 좀 부탁드립니다.

 

이 질문에 댓글 쓰기 :

답변 2

참고하세요

http://htglss.tistory.com/113

it seems like styling the HTML element to be overflow:hidden inside of a style tag doesn't work -- you need to put it in as a style attribute for the HTML tag (even though that's not valid). So... This: <html style="overflow: hidden;"> <head></head> <body>stuff</body> </html> Not this: <html> <head><style type="text/css"> html { overflow:hidden; } </style></head> <body>stuff</body> </html>

출처: http://htglss.tistory.com/113 [행복하기]

iframe에서 불러오는 파일의 html에 overflow:hidden; 속성을 주어야 한답니다. 그렇게 적용했더니 훌륭하게 작동하는 군요. 혹시나 이 문제 때문에 고생하신 분들은 이 방법을 사용해 보심이 좋을 것 같습니다..

이렇게 나와 있어서
ac.kr 부분 html 부분에 <html style="overflow: hidden;"> 삽입 했으나 스크롤은 계속 나오네요.

<html style="overflow: hidden;">
<script type="text/javascript">
function updateIFrame( height ) {
var iframe = document.getElementById( 'myiframe' );
iframe.setAttribute( '+ 'height', height );
}
</script>

<style type="text/css"> html { overflow:hidden; } </style>

</html>
<iframe id="myiframe" src="http://해당도메인" scrolling="yes" frameborder="0" width="100%" height="100%"></iframe>

 

이런식으로 하니 되긴 하네요.

감사합니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 790
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT