首页 文章

iFrame隐藏滚动条但仍能用鼠标滚轮滚动

提问于
浏览
2

我要做的是制作一个iPhone模拟器,并在iFrame中显示一个网页 . 滚动条占用了太多空间,所以我想要隐藏它们但仍然能够滚动 .

这是HTML:

<div id="iphone">
    <iframe src="http://site.com" width="307" height="443"><p>Your Browser does not support iFrames.</p></iframe>
</div>

CSS:

#iphone { background:url(iPhone.png) no-repeat; width:368px; height:706px; position:relative; overflow:hidden;  }
#iphone iframe { position:absolute; left:30px; top:143px; border:0;overflow:hidden; }

现在它工作正常,滚动条被隐藏但我无法滚动 . 我可以使用我的箭头键,它工作正常,但我真的希望能够使用鼠标滚轮

有没有人有任何想法?

1 回答

相关问题