gpt4 book ai didi

javascript - 不禁用以下内容的 Html Canvas Overlay

转载 作者:行者123 更新时间:2023-11-30 15:51:21 25 4
gpt4 key购买 nike

我想将红色边框定义的 Canvas 放在当前位于其下方的 div(黑色边框)上。它应该与 div 具有相同的大小。我还希望能够单击按钮并选择 Canvas 下方的文本。我已经尝试这样做了 2 天,但无法弄清楚...

enter image description here

<canvas id="canvas">

</canvas>
<div class="jumbotron">
<div class="container-fluid" id="canvas-container">
</div>
</div>

当前的 css(我知道这很乱,但我已经尝试了很多东西)

html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
margin-top: 50px; /* Required margin for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}

.footer > .container {
padding-right: 15px;
padding-left: 15px;
}

code {
font-size: 80%;
}

.jumbotron
{
text-align: center;
}
#canvas-container
{
padding: 0;
//position: absolute;
border: 1px solid black;
}
.jumbotron
{
padding: 0;
#position: absolute;
}

canvas {
border: 1px solid red;
}

最佳答案

您需要指定:

canvas {
pointer-events:none;
}

这是一个 js fiddle ,您可以在其中测试点击黑框位于红框下方的区域:

https://jsfiddle.net/1n1bp7m9/1/

关于javascript - 不禁用以下内容的 Html Canvas Overlay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39279560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com