2016-04-29 2 views
0

私は、次のコードを使用してiframe内にHTMLコンテンツを表示していますにすべてのクリックを無効にする方法をインラインフレーム

VAR D = $(prentElem).find( '#のpreviewEmailTemplateIframe')[0] .contentWindow.document。 d.open(); d.close(); $( "body"、d).append(htmlPopUpContent);

このiframeのすべてのクリックイベントを無効にすることができます。ドメインに変更はありません。

答えて

1
after some workaround i got this to work 

      x = $(prentElem).find('#' + Iframe).contents(); 
      $(x).find('body').attr('oncontextmenu', 'return false'); 

for MAC machines force touch 

     $(x).on('webkitmouseforcedown', function (event) { 
       event.preventDefault(); 
       return false; 
      }) 

      $(x).on('webkitmouseforcewillbegin', function (event) { 
       event.preventDefault(); 
       return false; 
      }) 

      For normal click disable 

      $(x).click(function (e) { 
       e.preventDefault(); 
       return false; 
      }); 

    It does not look good but it solved my issue...so posting this if anybody faces the same !!!! 

But still mozilla firefox does not allow the middle mouse button click to be disabled so this wont work there!! 
関連する問題