Fixed position not working in Safari 7

房东的猫 提交于 2019-12-04 06:54:50
steel

BUG FOUND:

I was able to trace the bug to a hardware-acceleration "trick" we were using by including these two rules in a parent element:

transform: translateZ(0)
perspective: 1000

By removing these two rules, the element now behaves as expected. More good information about this issue here: CSS performance relative to translateZ(0)

Bonus Bug Fix: Removing these rules in the HTML body caused various element-overlap problems in our PhantomJS/Poltergeist tests. Apparently PhantomJS doesn't move elements properly on its own. We included these rules only for the tests and currently everything is running fine.

ORIGINAL SOLUTION:

I was able to fix this problem by pulling the counter from the parent container:

<article class="parent">
  <article class="inner-wrapper">
    ...
  </article>
  <div id="counter">
    Character Count: <span class="tally">*javascript calculation*</span>
  </div>
</article>

Try this fiddle

http://jsfiddle.net/sosypjLg/1/

#counter {
position: fixed;
bottom: 0;
width: 100%;
}

you need this css style

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!