Safari/Chrome (Webkit) - Cannot hide iframe vertical scrollbar

前端 未结 17 997
粉色の甜心
粉色の甜心 2020-11-28 05:32

I have an iframe on www.example.com that points to support.example.com (which is a CNAME to a foreign domain).

I automatically resize the height of my i

17条回答
  •  甜味超标
    2020-11-28 06:30

    1.when you change iframe's scrolling yes or no, the iframe's scrollbar dosen't show immediately, you must refresh the iframe.

    2.the html tap overflow in iframe colud influence the iframe's scrollbar

    3.in the IE,you must clear iframe's src,then refresh iframe ,it will be work

    4.so, show you the code

    html

    
    
    

    javascript

    var ifrm = document.getElementById("main_ifrm");
    var btn1 = document.getElementById("btn1");
    btn1.onclick = function(){
        $(ifrm).prop("scrolling","no");
        $(ifrm.contentWindow.document).find("html").css("overflow","hidden")
        var src = $(ifrm).prop("src");
        $(ifrm).prop("src","");
        $(ifrm).prop("src",src);
    }
    

提交回复
热议问题