小编M.A*_*ish的帖子

为什么 html2canvas 顶部有一个空白区域?

我的有一个空白区域,我html2canvas不确定发生了什么。到目前为止,这是我的代码。

function doFunction() {

  html2canvas(document.querySelector("#capture"), ).then(canvas => {
    $("body").append(canvas);
  });
}

$("button").click(function() {
  doFunction();
});
Run Code Online (Sandbox Code Playgroud)
div {
  box-sizing: border-box;
  font-family: 'ABeeZee', sans-serif;
}

body {
  background-color: red;
}

#capture {
  width: 900px;
  height: 900px;
  background-color: aqua;
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://html2canvas.hertzen.com/dist/html2canvas.js"></script>
<div id="capture">
  Hello
</div>
<button type="button">Click Me!</button>
Run Code Online (Sandbox Code Playgroud)

这是附加的画布。请注意,顶部有一个空白区域。我怎样才能删除它?

在此处输入图片说明

html javascript css html2canvas

20
推荐指数
1
解决办法
6736
查看次数

react-leaflet 获取当前的经纬度 onClick

如果有人可以帮助我,我会非常高兴......我已经在我的反应项目中安装了反应传单并且地图组件已成功加载,我需要获取当前的纬度并在我单击地图时将其显示在弹出窗口中但我不知道怎么做:(

拜托……拜托……帮帮我……

这是我的代码

import React from 'react'
import { Map as LeafletMap, TileLayer, Marker, Popup } from 'react-leaflet';

class Mapp extends React.Component {
    componentDidMount() {

    }

    render() {
        return (
            <LeafletMap
                center={[35.755229,51.304470]}
                zoom={16}
                maxZoom={20}
                attributionControl={true}
                zoomControl={true}
                doubleClickZoom={true}
                scrollWheelZoom={true}
                dragging={true}
                animate={true}
                easeLinearity={0.35}
            >
                <TileLayer
                    url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
                />
                <Marker position={[35.755229,51.304470]}
                draggable={true}
                >
                    <Popup >
                        Popup for any custom information.
                    </Popup>

                </Marker>
            </LeafletMap>
        );
    }
}

export default Mapp;
Run Code Online (Sandbox Code Playgroud)

leaflet reactjs react-leaflet

8
推荐指数
3
解决办法
1万
查看次数

我怎样才能在上面(它是 z-index)ExpansionPanel 上拉出 react-select 的下拉菜单?

我在 ExpansionPanel(material-ui 的一个组件) 中使用了 react-select ,它使 ExpansionPanel 成为不需要的滚动。我该如何解决?我试图改变 z-index ,但没有奏效。考虑图片中的第三个选择,它的下拉菜单被 ExpansionPanel 隐藏了。先感谢您。

在此处输入图片说明

                <Select
                   value={state.selectedPerson}
                   onChange={handleMitarbeiterChange}
                   options={state.peopleOptions}
                   textFieldProps={{
                   label: 'Mitarbeiter',
                   id: "mitarbeiter-required",
                   InputLabelProps: {
                     shrink: true,
                   },
                 }}
                />
Run Code Online (Sandbox Code Playgroud)

z-index react-select material-ui

0
推荐指数
2
解决办法
2969
查看次数