chore: Anchor 动画优化。 (#4011)

- close #3832
 - 点击后给样式就行了, 不要把动画删掉
This commit is contained in:
陆离 2016-11-25 15:05:19 +08:00 committed by Benjy Cui
parent 86f1fa030a
commit 72fad02024

View File

@ -83,11 +83,9 @@ export default class Anchor extends React.Component<AnchorProps, any> {
} }
clickAnchorLink = (href, component) => { clickAnchorLink = (href, component) => {
this.refs.ink.style.transition = 'top 0.01s ease-in-out';
this._avoidInk = true; this._avoidInk = true;
this.refs.ink.style.top = `${component.offsetTop + component.clientHeight / 2 - 4.5}px`; this.refs.ink.style.top = `${component.offsetTop + component.clientHeight / 2 - 4.5}px`;
this.anchorHelper.scrollTo(href, getDefaultTarget, () => { this.anchorHelper.scrollTo(href, getDefaultTarget, () => {
this.refs.ink.style.transition = 'top 0.3s ease-in-out';
this._avoidInk = false; this._avoidInk = false;
}); });
} }