iframe, img, div 크기 줄이기

iframe, img, div 크기 줄이기

QA

iframe, img, div 크기 줄이기

본문

안녕하세요

<div class="main">

<iframe frameborder="0" width="700" height="250" src="http://xxx" scrolling="no" marginwidth="0" marginheight="0" border="0"> 

</div>


위 코드 인데요

제 사이트는 가로가 600 입니다.

div에서 width:600px

를 주면 iframe 이미지 오른쪽 100px이 잘려버리네요

이미지를 자르지 않고 600px로 축소 하는 방법이 있을까요?

이 질문에 댓글 쓰기 :

답변 2

<iframe id="fr" 

 

<script>

$('#fr').load(function() {

  var width = $('.main').width();

  $('#fr').contents().find('img').each(function() {

    if ( $(this).width() > width) $(this).width(width);

  });

});

</script>

<iframe id="fr" frameborder="0" .....................>
<script>
$('#fr').load(function() {
  var width = $('.main').width();
  $('#fr').contents().find('img').each(function() {
    if ( $(this).width() > 661) $(this).width(660);
  });
});
</script>

이렇게 해봤는데 안되네요 ㅜㅜㅜ

iframe 너비가 700 으로 잡혀서 그런 것 같네요.

 

걍 100%로 줘보세요.

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

회원로그인

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