0

http://denishoctor.me/readertest.html(以下のコードも)を使用した簡単なセットアップがあります。ボタンは、埋め込まれたPDF上でダイアログを開きます。これは、IE6/7/8以外のすべてで問題ありません。

誰かがこれを止める方法を知っていますか?

ありがとう、デニス

<button type="button">Click Me</button>

<iframe id="iFrameResponse" style="margin-left:250px;height:500px;width:100%" src="http://knowwheretheygo.org/media//static/content/sample.pdf"></iframe>

<div id="InformationDialog" style="display: none;">This is my info</div>

<script type="text/javascript">
  $(document).ready(function() {
      $( "#InformationDialog" ).dialog( {
          title: "Information",
          autoOpen: false,
          hide: "slide",
          show: "slide",
          width: 225,
          position: [100,125],
          height: 400
      } );

      $("button").click(function() {
        $("#InformationDialog").dialog('open'); return false; 
      });
   });
</script>

更新:http://groups.google.com/group/jquery-ui/browse_thread/thread/66c7d2d31feedea9?fwc=1が見つかりましhttp://brandonaaron.net/code/bgiframe/docs/について話しているのはどれですか。前述のように、IE for PDFで機能させるには、どのような変更が必要かを知っている人はいますか?

4

2 に答える 2

1

もちろん、これは理想的ではありませんが、機能し、他に何も見たことがありません。また、これはIE6 / 7/8に対してのみ行い、優れたブラウザーを罰しないでください。

ポップアップの下とPDFの上にiFrameを貼り付けます。jQueryUIダイアログのドラッグとサイズ変更をオフにすると、これはうまく機能します。それらをオンにすると、塗り直しと位置付けであると私が想定しているため、フリックが発生しているようです。

例は@http://denishoctor.me/examples/iframepdf/test.htmlで見つけることができます

于 2011-05-16T01:37:59.910 に答える
1

私のテクニックは、単に iframe のサイズを変更/非表示にすることです。Safari では、iframe のサイズを変更する必要があります。

     $("#pdf").css("visibility", "hidden");
     if (navigator.userAgent.indexOf("Safari") > -1) {
        $("#pdf").height("5px");
      }
      $("#dialog-modal").dialog({
            height: 350,
            width: 800,
            buttons: [
            {
                text: "Close",
                click: function() {
                    $("#pdf").css("visibility", "visible");
                        if (navigator.userAgent.indexOf("Safari") > -1) {
                          $("#pdf").height("500px");
                        }
                }
            }],

            close: function(event, ui) {
                $("#pdf").css("visibility", "visible");
                if (navigator.userAgent.indexOf("Safari") > -1) {
                    $("#pdf").height("500px");  //whatever the height of your PDF iframe is
                }
            }
});
于 2012-06-05T22:55:25.683 に答える