springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:23:57
103
这是我的代码:
function go(){
let container=document.getElementById("container");
let selector=document.getElementById("selector");
let domRect = container.getBoundingClientRect();
selector.style.bottom=domRect.height+"px";
/*
selector.style.top=domRect.height+"px";
*/
console.log(domRect.toJSON());
}
.container,
.result,
.selector{
display:inline;
position:relative;
}
.selector{
background-color:red;
left:0;
position:absolute;
z-index:10;
}
<代码><;TABLE_WIDTH=“ 70%” CLASSNAME=“ BB ” BORDER=“ 1 ”>;<;正文(>;)<;TR>;<;TD>;名称<;/TD>;<;TD>;陈大文<;/TD>;<;/tr>;<;TR>;<;TD>;出生日期<;/TD>;<;TD>;<;DIV类=“容器” ID=“容器”>;<;DIV类=“结果” ID=“结果”>;1<;/DIV>;<;DIV类=“选择器” ID=“选择器”>;2<;/DIV>;<;/DIV>;<;button onclick=“ go()”>;go<;/button>;<;/TD>;<;/tr>;<;TR>;<;TD>;gg<;/TD>;<;TD>;<;按钮>;转到<;/按钮>;<;/TD>;<;/tr>;<;TR>;<;TD>;性别<;/TD>;<;TD>;男性<;/TD>;<;/tr>;<;/t正文>;<;/表格>;
当我单击<table width="70%" className="bb" border="1">
<tbody>
<tr>
<td>Name</td>
<td>Chan Tai Man</td>
</tr>
<tr>
<td>Date of Birth</td>
<td>
<div class="container" id="container">
<div class="result" id="result">1</div>
<div class="selector" id="selector">2</div>
</div><button onclick="go()">Go</button>
</td>
</tr>
<tr>
<td>gg</td>
<td>
<button>Go</button>
</td>
</tr>
<tr>
<td>Sex</td>
<td>Male</td>
</tr>
</tbody>
</table>
按钮时,go
层移动到selector
的上方。
selector.style.bottom=domRect.height+";px";
如果我将其更改为以下内容,则不起作用
<块引用>selector.style.bottom=domRect.top+";px";
顺晟科技:
恐怕这在CSS中是不可能的。您必须在JS中按照您希望的方式重新创建HTML元素。如果您想这样做,您可以使用JS方法,如container
document.createElement()
和parent.removeChild('childName')
)
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11