强制 Flash 的底部边距为负值
我有一个 .swf 导航轮播,高度为 650 像素,底部 200 像素保留用于轮播的反射。反射非常微妙,不被视为重要信息,因此当窗口足够高以容纳最上面的 450 个像素时,我们希望删除垂直滚动条,但不删除反射。
我尝试通过为 flash
除了使用 JavaScript 主动隐藏/显示滚动条之外,是否有一些“正确”的修复方法?
I have an .swf navigation carousel that is 650 pixels high, the bottom 200 pixels being reserved for the reflection of the carousel. The reflection is very subtle and is not considered important information, so we would like to remove vertical scrollbars when the window is high enough to fit the topmost 450 pixels, but not the reflection.
I tried to accomplish this by setting a margin-bottom: -200px
to the flash <object>
but this only made the container's height shrink 200 pixels, causing the background pattern to cut before the bottom of the page. The Flash itself is still taking up 650 pixels.
Is there some "proper" fix to this, other than hiding/showing the scrollbars actively using javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用 css:
抱歉,我以为您正在尝试从元素中删除滚动条。如果你想让它们离开窗口,只需执行
body {overflow:hidden}
,只有当你执行
overflow:hidden
时,元素的某些部分才会被切断,如果元素的内容大于其容器,因此您可能需要研究一下。当窗口高度达到 450px 时,尝试使用此方法隐藏溢出:
您可能遇到的一个问题是,某些浏览器喜欢在调整大小期间触发大量调整大小事件,而不是在调整大小之后触发大量调整大小事件,这可能会影响性能。 Paul Irish 在 http://paulirish.com 上撰写了一篇关于缓解此问题的简短博客文章/2009/throttled-smartresize-jquery-event-handler/ 我认为 jQuery 的 .resize() 函数会自动执行此操作。
You could try using css:
My apologies, I thought you were trying to remove scrollbars from the element. If you want to get them off of the window, just do
body {overflow: hidden}
Parts of the element will only get cut off when you do
overflow: hidden
if the content of the element is larger than its container, so you may want to look into that.Try this to hide the overflow when the window height reaches 450px:
An issue you may have with this is that some browsers like to fire a lot of resize events during resizing, instead of one after, which could impact performance. Paul Irish wrote a short blog post about mitigating this at http://paulirish.com/2009/throttled-smartresize-jquery-event-handler/ and I think that jQuery's .resize() function does this automatically.