开发者

Problem with Chrome 12.0.742.100 and empty a/span positioning

开发者 https://www.devze.com 2023-03-13 23:03 出处:网络
For a site i made, http://crystalmurray.com, i have a simple little script to smooth scroll to local anchors and push the anchor to the history like it never happened. Recently my chrome updated to 12

For a site i made, http://crystalmurray.com, i have a simple little script to smooth scroll to local anchors and push the anchor to the history like it never happened. Recently my chrome updated to 12.0.742.100 and this stopped working, however, it worked fine in safari an开发者_如何学Pythond firefox.

The obvious workaround for it is to add content to each empty anchor tag and hide it, whether manually or programmatically.

Heres an example and tester for it http://jsfiddle.net/arzynik/zfmgt/

Both empty a and empty span tags fail to position correctly.

Any other suggestions? Id rather keep editing to a minimum when updating other sites.


Your test seems to work in Chrome 14.0.794.0 (canary). The problem is probably already solved in a future version. You can wait Or file a bug report.


I encountered this same issue recently. My workaround for Chrome 12 was to set position: relative for any empty anchor tags I had. The following should fix you up:

a:empty {
    position:relative;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号