jQuery CSS 渲染 - 适用于 Firefox,不适用于 Chrome
我使用 jQuery 滑块来调整包含段落文本的 DIV 的填充。当我均匀地增加所有边的填充时,它应该迫使所包含的段落进入页面中心的越来越窄的列。
这在 Firefox 中有效,但在 Chrome 中,段落宽度保持不变(即,当 DIV 的填充推入它们时,它们不会变窄),因此将布局推到右侧。
我在这里重新创建了该问题:jsfiddle.net/ms3Jd。您可以在 Chrome 和 Firefox 中尝试一下,看看有什么不同。
关于如何强制 Chrome 刷新所附段落有什么想法吗?
I'm using a jQuery slider to adjust the padding of a DIV containing paragraph text. As I increase the padding on all sides equally, it should force the enclosed paragraphs into an ever-narrower column, in the center of the page.
This works in Firefox, but in Chrome the paragraph widths remain constant (i.e. they don't become narrower as the DIV's padding pushes in on them), so pushing the layout to the right.
I've recreated the issue here: jsfiddle.net/ms3Jd. You can try it in Chrome and Firefox to see the difference.
Any ideas on how to force Chrome to refresh the enclosed paragraphs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
摘自此处:我如何强制WebKit 重绘/重绘以传播样式更改?
我在这里快速应用了它,但您应该将其变成一个函数:http://jsfiddle.net/thirtydot/ms3Jd/5/
Taken from here: How can I force WebKit to redraw/repaint to propagate style changes?
I quickly applied it here, but you should make it into a function: http://jsfiddle.net/thirtydot/ms3Jd/5/
我正在使用
fadeTo
强制 chrome 刷新。不确定,但我猜是
fadeTo
上的动画起到了作用在 jsfiddle 上尝试该行。
I'm using
fadeTo
to force chrome to refresh.Not sure but I guess it's the animate on
fadeTo
that does the tricktry that line on jsfiddle.
您可以添加溢出和浮动属性:
You can add the overflow and float properties: