< div th:fragment = "home_head" >
< head >
< style >
.homePage{
color: #fff;
font-size: 21px;
display: block;text-align: center;
font-weight: bold;padding: 0 14px;
letter-spacing: 2px;
}
#hd {
position: relative;
//background-image: url(/home/base/bg-head5.png);
//background-position-y:56%;
height: 326px;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
#hd .bg_image1{
width:100%;
height:100%;
}
#ltlogo {
position: absolute;
top: 43%; /* 将图像元素垂直居中 */
left: 30%; /* 将图像元素水平居中 */
height: 82px;
transform: translate(-50%, -50%);
}
#dhl {
padding-bottom: 0;
font-style: inherit;
}
.layui-nav {
position: absolute;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
background-color: rgba(1,78,155,0.7);
}
< / style >
< / head >
< div id = "hd" >
< div class = "layui-carousel" id = "ID-carousel-demo-1" style = "width: 100%;height: 326px;" >
< div carousel-item >
< div >
< img class = "bg_image1" th:src = "@{/home/base/bg-head5.png}" >
< / div >
< / div >
< / div >
< img th:src = "@{/home/base/lantie3.png}" id = "ltlogo" >
< ul class = "layui-nav" id = "dhl" >
< li class = "layui-nav-item" >
< a href = "base.html" class = "homePage" > 首页< / a >
< / li >
< li class = "layui-nav-item" >
< a href = "announce_view.html" class = "homePage" > 通知公告< / a >
< / li >
< li class = "layui-nav-item" >
< a href = "work_view.html" class = "homePage" > 工作动态< / a >
< / li >
< li class = "layui-nav-item" >
< a href = "dept_trends_view.html" class = "homePage" > 部门动态< / a >
< / li >
< li class = "layui-nav-item" >
< a href = "business_view.html" class = "homePage" > 检察业务< / a >
< / li >
< li class = "layui-nav-item" >
< a href = "special_view.html" class = "homePage" > 专题活动< / a >
< / li >
< form action = "" id = "search_form" class = "layui-form" style = "display:flex;margin-top:11px;margin-left:40px;" >
< label >
< input name = "title" id = "title" type = "text" placeholder = "请输入搜索内容" class = "layui-input" >
< / label >
< button class = "layui-btn" onclick = "queryList()" > 搜索< / button >
< / form >
< / ul >
< / div >
< script th:src = "@{/js/jquery.min.js?v=3.6.3}" > < / script >
< script th:src = "@{/home/lib/layui.js}" > < / script >
< script type = "text/javascript" >
layui.use(function(){
var carousel = layui.carousel;
// 渲染 - 常规轮播
carousel.render({
elem: '#ID-carousel-demo-1',
width: 'auto',
indicator:'none',
arrow:'none',
width: '100%',
height: '326px',
});
});
function queryList(){
var title = $("#title").val();
if (title){
$('#search_form').submit(function(){
var actionStr="/search";
$("#search_form").removeAttr("action").attr("action",actionStr);
return true;
});
}else{
alert("请输入查询关键字!")
}
}
< / script >
< / div >