javascript – jQuery CSS渲染 – 适用于Firefox,而不是Chrome

前端之家收集整理的这篇文章主要介绍了javascript – jQuery CSS渲染 – 适用于Firefox,而不是Chrome前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用jQuery滑块来调整包含段落文本的DIV的填充.当我平等地增加所有方面的填充时,它应该强制所附的段落到页面中心的一个更窄的列.

这在Firefox中起作用,但在Chrome中,段落宽度保持不变(即,DIV的填充不会变窄,因此将布局向右推.

我在这里重新创建了这个问题:jsfiddle.net/ms3Jd.您可以在Chrome和Firefox中尝试看到差异.

关于如何强制Chrome刷新封闭段落的任何想法?

解决方法

I know there are ways to force (or trick) Chrome to
refresh/redraw/recalcuate the page elements,but don’t know how to do
it. Any ideas?

取自:How can I force WebKit to redraw/repaint to propagate style changes?

sel.style.display='none';
sel.offsetHeight; // no need to store this anywhere,the reference is enough
sel.style.display='block';

我很快就把它应用到这里,但你应该把它变成一个功能http://jsfiddle.net/thirtydot/ms3Jd/5/

原文链接:https://www.f2er.com/jquery/154522.html

猜你在找的jQuery相关文章