mirror of
https://github.com/infeng/react-viewer.git
synced 2025-12-08 17:36:40 +00:00
Update ViewerNav.tsx
fixed marginLeft
This commit is contained in:
parent
ec26810ced
commit
fd1ea5f05e
@ -21,9 +21,10 @@ export default class ViewerNav extends React.Component<ViewerNavProps, any> {
|
||||
}
|
||||
|
||||
render() {
|
||||
let marginLeft = (Math.ceil(this.props.images.length / 2) - this.props.activeIndex - 1) * 1.5 * 30;
|
||||
var marginLeft = `calc(50% - ${this.props.activeIndex + 1} * 31px)`;
|
||||
let listStyle = {
|
||||
marginLeft: `${marginLeft}px`,
|
||||
marginLeft: marginLeft,
|
||||
textAlign: 'left'
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user