我正在嘗試使我的漢堡菜單更?。ǜ叨群蛯挾龋⑶椅乙呀?jīng)嘗試了一段時(shí)間并使其更小但由于某種原因無(wú)法弄清楚如何使其更小。我也在努力嘗試在它周圍制作一個(gè)完美的圓形邊框。有人可以幫我嗎?我在 codepen 中找到了這段代碼并對(duì)其進(jìn)行了一些調(diào)整,但我正在努力讓它恰到好處。jsfiddle:https ://jsfiddle.net/annahisenberg/ft10ersb/6/JS代碼:class Drag extends React.Component { constructor(props) { super(props); this.state = { x: this.props.x, y: this.props.y, showMoreOptionsPopup: false, showHelpModal: false }; this.reff = React.createRef(); this.dragMouseDown = this.dragMouseDown.bind(this); this.elementDrag = this.elementDrag.bind(this); this.closeDragElement = this.closeDragElement.bind(this); this.showMoreOptionsPopup = this.showMoreOptionsPopup.bind(this); } componentDidMount() { this.pos1 = 0; this.pos2 = 0; this.pos3 = 0; this.pos4 = 0; } dragMouseDown(e) { e.preventDefault(); this.pos3 = e.clientX; this.pos4 = e.clientY; document.onmouseup = this.closeDragElement; document.onmousemove = this.elementDrag; }; elementDrag(e) { e.preventDefault(); this.pos1 = this.pos3 - e.clientX; this.pos2 = this.pos4 - e.clientY; this.pos3 = e.clientX; this.pos4 = e.clientY; this.setState({ y: this.reff.current.offsetTop - this.pos2 + "px", x: this.reff.current.offsetLeft - this.pos1 + "px" }); }; closeDragElement() { document.onmouseup = null; document.onmousemove = null; }; showMoreOptionsPopup() { this.setState({ showMoreOptionsPopup: !this.state.showMoreOptionsPopup }); };render() { return ( <div> {this.state.showMoreOptionsPopup && ( <div id="more_options_popup" style={{ left: this.reff.current.offsetLeft - 170 + "px", top: this.reff.current.offsetTop - 130 + "px" }} > <p>Help Doc</p> <p>Help Doc 2</p> <p>Help Doc 3</p> </div> )}
我怎樣才能讓我的漢堡菜單更小,并在它周圍有一個(gè)完美的圓形邊框?
江戶川亂折騰
2022-01-07 16:38:09