我的有一个空白区域,我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)
这是附加的画布。请注意,顶部有一个空白区域。我怎样才能删除它?
如果有人可以帮助我,我会非常高兴......我已经在我的反应项目中安装了反应传单并且地图组件已成功加载,我需要获取当前的纬度并在我单击地图时将其显示在弹出窗口中但我不知道怎么做:(
拜托……拜托……帮帮我……
这是我的代码
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) 我在 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) css ×1
html ×1
html2canvas ×1
javascript ×1
leaflet ×1
material-ui ×1
react-select ×1
reactjs ×1
z-index ×1