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;
}
精彩评论