2

私はオーバーラップ画面(Facebookのフォトビューアなど)を作成していますが、今のところクロム、サファリ、ファイアフォックスで正常に動作しますが、IEでも動作する必要があります。実際には、divは私が望むように完全に重なり合っていますが、スクロールすることはできません。だから私はオーバーフローを使用しようとしました: hidden; ボタンがクリックされたときにスクロールしないようにします。正常に動作しますが、今私の問題は、もう一度スクロールできるようにすることです。私は両方ともoverflow: autoといくつかのjquery関数を試しましたが、うまくいかないようです。また、 $(document).ready(function() { ... }); などのjqueryを実行できないことも検出しました。

オーバーラップするために使用しているコード:

var outercontent = document.getElementById('transparent')
var innercontent = document.getElementById('innercont')
browser = navigator.appName;
explore = "Microsoft Internet Explorer";
if(browser == explore) {
    outercontent.style.zIndex = '9989';
    outercontent.style.display = 'block';
    outercontent.style.position = 'absolute';
    outercontent.style.top = '0';
    outercontent.style.left = '0';
    outercontent.style.width = viewportwidth;
    outercontent.style.height = viewportheight;
    outercontent.style.margin = '0';
    outercontent.style.padding = '0';

    innercontent.style.left = '20%';
    innercontent.style.background = 'white';
    innercontent.style.zIndex = '9999';
    innercontent.style.width = '60%';
    innercontent.style.height = '80%';
    innercontent.style.marginBottom = '10%';
    innercontent.style.marginTop = '5%';
    innercontent.style.padding = '10px';

}

そして、私のhtmlページ内にdivを配置しました:

<div id='transparent' style='background-color: rgba(0, 0, 0, 0.5);
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,
StartColorStr='#e5000000',EndColorStr='#e5000000');
text-align: center;'>
    <div id='innercont' style='position: absolute; color: black;'></div>
</div>
4

1 に答える 1

0

<div>コンテンツをwithheight: 100%; overflow: hidden;の内側にラップするのは#innercontどうですか? それはより制御可能であるべきです。

于 2012-07-16T12:30:32.747 に答える