sIFR 3 r436 歌剧 + 火狐浏览器浮动问题
我在将 sifr 放置在浮动 img 旁边时遇到问题,Opera 9.6 强制文本清除图像并显示在一行上。 Firefox 还会在第一次加载页面时强制清除文本,尽管刷新修复了这一点,并且该问题将永远不会再次发生,只有在清除缓存并重新启动浏览器时才会返回。
同样用firefox勒死,如果发生错误然后我加载firebug,这会将文本拍摄到与图像内联的正确位置,非常奇怪,因为我不认为firebug导致dom重新加载。
I’m having an issue with sifr placed next to a floated img, Opera 9.6 is forcing the text to clear the image and display on one line. Firefox is also forcing the text to clear the first time the page is loaded, although a refresh fix’s this and the problem will never occur again, only to return if cache is cleared and the browser restarted.
Also strangley with firefox, if the bug occurs and then i load up firebug, this shoots the text up to the correct position inline with the image, very strange as i did not think firebug caused the dom to reload.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这通常是一个时间问题。 当 sIFR 替换元素时,图像尚未加载,因此要替换的元素是容器的整个宽度。 sIFR 将插入此宽度的 Flash 影片,一旦所有内容正确渲染,该影片将无法与图像相邻。 当您打开 Firebug 时,您可以调整网页视口的大小。 这会触发 sIFR 中的大小调整,并导致 sIFR 检测被替换元素的正确宽度。
解决方案:
宽度
和高度
,以便加载时布局不会改变fitExactly
将Flash影片制作为与它包含的文本一样宽。 这将有助于防止清除,当然,除非文本长于可用空间sIFR.activate()
之前设置sIFR.useDomLoaded = false;
以使 sIFR 替换元素页面加载时 — 图像加载后您可能还需要调整要替换的元素上的字母间距,以便 HTML 文本的宽度正确反映 Flash 文本将占用的宽度。 如果 Flash 报告的文本宽度值不正确,请使用
tuneWidth
和offsetLeft
属性进行调整。This is usually a timing issue. When sIFR replaces the elements, the image isn't yet loaded so the to-be-replaced element is the full width of the container. sIFR will insert a Flash movie of this width, which won't fit next to the image once everything is properly rendered. When you open Firebug, you resize the viewport of the web page. This triggers a resize in sIFR and causes sIFR to detect the proper width of the replaced element.
Solutions:
width
andheight
on the image so the layout doesn't change when it loadsfitExactly
to make the Flash movie as wide as the text it contains. This will help prevent the clearing, unless of course the text is longer than the available spacesIFR.useDomLoaded = false;
beforesIFR.activate()
to make sIFR replace elements on page load — after the image has been loadedYou might also need to adjust letter spacing on the to-be-replaced elements such that the width of the HTML text properly reflects the width that will be taken up by the Flash text. And in case Flash is reporting incorrect values for the text width, use the
tuneWidth
andoffsetLeft
properties to adjust.