2009-08-29 2 views
0

이 이미지는 지금를 Swf 삽입 개체를 올리버으로 스크립트의 크기를 조정 (원본 이미지의 크기를 조정할 수있는 스크립트에 부모 사업부 컨테이너의 100 % 폭의 크기를 조정합니다 DIV 플래시는 100 % 적합 확인 Boomerans ollicle.com/eg/jquery/imagefit/)jQuery를 내가 스크립트 느릅 나무를 다시 관리했습니다

나는 img 태그의 매개 변수가 너비와 높이 값을 대체해야하는 모든 라인에서 img를 "embed"로 대체했습니다.

Firefox에서는 모든 것이 작동하지만 IE 7에서는 전혀 작동하지 않습니다. IE 7에서 오류를 외치는 동안

Here a link to my Project

는 파이어 폭스에서 잘 크기를 조정 플래시 비디오를 볼. 여기

내 JQuery와 JS 함수 :

(function($) { 
$.fn.imagefit = function(options) { 
    var fit = { 
     all : function(imgs){ 
      imgs.each(function(){ 
       fit.one(this); 
       }) 
      }, 
     one : function(img){ 
      $(img) 
       .width('100%').each(function() 
       { 
        $(this).height(Math.round(
         $(this).attr('startheight')*($(this).width()/$(this).attr('startwidth'))) 
        ); 
       }) 
      } 
    }; 

    this.each(function(){ 
      var container = this; 

      // store list of contained images (excluding those in tables) 
      var imgs = $('img', container).not($("table img")); 

      // store initial dimensions on each image 
      imgs.each(function(){ 
       $(this).attr('startwidth', $(this).width()) 
        .attr('startheight', $(this).height()) 
        .css('max-width', $(this).attr('startwidth')+"px"); 

       fit.one(this); 
      }); 
      // Re-adjust when window width is changed 
      $(window).bind('resize', function(){ 
       fit.all(imgs); 
      }); 
     }); 
    return this; 
}; 

}) (jQuery를);

다음은 각 기능 내가 트리거 기능에서 호출 모든 div를 통해 갈 책임이 있습니다 : jQuery를 (문서) .ready (함수() { jQuery를() flashfit(); '위젯 콘텐츠입니다.'.}) ;

어떻게 인터넷 익스플로러와 크롬에서도 사용할 수 있습니까? 어떤 아이디어?

+0

는 안녕 내가 [자바 스크립트로 전체 화면으로 플래시 크기를 조정하는 방법에] 여기이 질문에 대답 생각 [1] [1] : http://stackoverflow.com/questions/7826069/flash -website-bug-with-firefox-and-ie9-but-works-on-ie6/8052217 # 8052217 –

답변

1

대신 swffit 사용에 대해 생각해 보셨습니까? 이 기능은 컨테이너 내에서뿐만 아니라 전체 브라우저 크기의 Flash 파일 크기를 조정할 때도 효과적입니다. 고려해야 할 다른

http://swffit.millermedeiros.com/

뭔가 플래시 파일의 실제 구조는, 꽤 추한 얻을 수있는 스테이지 크기 또는 물건에 따라 구성 요소의 위치를 ​​업데이트하도록 설정해야합니다.

희망이 있습니다.

관련 문제