5

我有一个带有“scrolling="no"" 的 iframe 和一个在需要时将 iframe 属性设置为 scrolling="yes" 的按钮。

    $("#button3").click(function(){
    $( "#iframe_id" ).attr( "scrolling", "yes" );});    

但是滚动条没有出现,当我按下按钮3时,只有在我刷新 iframe 之后。如何强制 srcoll 条立即出现?

现在如何工作:http: //jsfiddle.net/77van/k8GhZ/1/

4

2 回答 2

6

现在 jquery 设置并.attr重新scrolling="yes"加载 iframe!

$(document).ready(function () {
    $("#button3").click(function () {
        $("#iframe_id").attr("scrolling", "yes");
        $('#iframe_id').attr("src", $('#iframe_id').attr("src"));
    });
});

http://jsfiddle.net/77van/k8GhZ/10/

于 2013-09-01T09:59:52.067 回答
2

相信我,你无法用 iframe 做到这一点。它不适用于 Chrome 或 IE。过去我玩过很多 iFrame,但这些东西对我来说从来没有用过。

iFrame 在加载后根本不接受任何更改

于 2013-09-01T09:56:39.450 回答