|
|
@@ -44,16 +44,22 @@ |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
.piece .content { |
|
|
|
width: 75%; |
|
|
|
width: 78%; |
|
|
|
max-height: 500px; |
|
|
|
box-sizing: border-box; |
|
|
|
overflow-y: auto; /* 超出内容出现滚动条 */ |
|
|
|
border-right: 1px solid #ccc; /* 右边框 */ |
|
|
|
scrollbar-width: thin; /* Firefox: 设置滚动条宽度为细 */ |
|
|
|
scrollbar-color: #888 #f1f1f1; /* Firefox: 滚动条颜色和背景颜色 */ |
|
|
|
overflow-y: auto; |
|
|
|
overflow-x: hidden; |
|
|
|
border-right: 1px solid #ccc; |
|
|
|
scrollbar-width: thin; |
|
|
|
scrollbar-color: #888 #f1f1f1; |
|
|
|
} |
|
|
|
.piece .content .informationText { |
|
|
|
padding: 20px; |
|
|
|
word-wrap: break-word; |
|
|
|
white-space: normal; |
|
|
|
} |
|
|
|
.piece .sidebar { |
|
|
|
width: 25%; |
|
|
|
width: 22%; |
|
|
|
max-height: 500px; |
|
|
|
padding: 10px 10px 10px 40px; |
|
|
|
position: relative; |
|
|
@@ -68,27 +74,58 @@ |
|
|
|
position: absolute; |
|
|
|
width: 0; |
|
|
|
height: 0; |
|
|
|
border-left: 16px solid blue; /* 三角形底部为左 */ |
|
|
|
border-left: 16px solid blue; |
|
|
|
border-right: 16px solid transparent; |
|
|
|
border-top: 8px solid transparent; |
|
|
|
border-bottom: 8px solid transparent; |
|
|
|
left: 10px; /* 三角形位置 */ |
|
|
|
top: 21px; /* 默认位置 */ |
|
|
|
transition: top 0.3s; /* 动画效果 */ |
|
|
|
left: 10px; |
|
|
|
top: 21px; |
|
|
|
transition: top 0.3s; |
|
|
|
} |
|
|
|
.sidebar .active { |
|
|
|
color: blue; |
|
|
|
} |
|
|
|
/* 自定义滚动条样式 */ |
|
|
|
.piece .content::-webkit-scrollbar { |
|
|
|
width: 6px; /* 设置更细的滚动条宽度 */ |
|
|
|
width: 6px; |
|
|
|
} |
|
|
|
.piece .content::-webkit-scrollbar-thumb { |
|
|
|
background: #888; /* 滚动条颜色 */ |
|
|
|
border-radius: 10px; /* 滚动条圆角 */ |
|
|
|
background: #888; |
|
|
|
border-radius: 10px; |
|
|
|
} |
|
|
|
.piece .content::-webkit-scrollbar-thumb:hover { |
|
|
|
background: #555; /* 滚动条悬停颜色 */ |
|
|
|
background: #555; |
|
|
|
} |
|
|
|
.multiLine-item { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
margin-bottom: 10px; |
|
|
|
padding: 5px 0; |
|
|
|
} |
|
|
|
.multiLine-item .left-content { |
|
|
|
flex: 0 0 180px; |
|
|
|
min-width: 180px; |
|
|
|
padding-right: 15px; |
|
|
|
} |
|
|
|
.multiLine-item .right-content { |
|
|
|
flex: 1; |
|
|
|
word-break: break-all; |
|
|
|
padding-left: 15px; |
|
|
|
} |
|
|
|
.informationText table { |
|
|
|
table-layout: fixed; |
|
|
|
border-collapse: collapse; |
|
|
|
} |
|
|
|
.informationText table th, |
|
|
|
.informationText table td { |
|
|
|
padding: 8px; |
|
|
|
word-wrap: break-word; |
|
|
|
white-space: normal; |
|
|
|
} |
|
|
|
.bg-color-1 { |
|
|
|
background-color: #f9f9f9; |
|
|
|
} |
|
|
|
.bg-color-2 { |
|
|
|
background-color: #ffffff; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</head> |
|
|
@@ -207,7 +244,7 @@ |
|
|
|
</div> |
|
|
|
<div class="piece" style="font-size: 16px;"> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div class="marks"></div><h3>学历 学位</h3><span style="flex: 0 0 calc(64% - 20px);" class="line"></span> |
|
|
|
<div class="marks"></div><h3>学历 ���位</h3><span style="flex: 0 0 calc(64% - 20px);" class="line"></span> |
|
|
|
</div> |
|
|
|
<div style="margin-left: 40px;border-bottom: 1px dashed #DBDBDB;width: 75%;"> |
|
|
|
<h3>全日制教育</h3> |
|
|
@@ -252,10 +289,13 @@ |
|
|
|
<div class="marks"></div><h3>简历</h3><span class="line"></span> |
|
|
|
</div> |
|
|
|
<div class="informationText"> |
|
|
|
<div th:if="${#lists.size(resumeLines) > 0}" th:each="line1, iterStat1 : ${resumeLines}" |
|
|
|
<div th:if="${#lists.size(resumeLines) > 0}" |
|
|
|
th:each="line1, iterStat1 : ${resumeLines}" |
|
|
|
th:class="${iterStat1.even} ? 'multiLine-item bg-color-1' : 'multiLine-item bg-color-2'"> |
|
|
|
<div th:each="line2,iterStat2:${line1}" |
|
|
|
th:class="${iterStat2.even} ? 'right-content' : 'left-content'" th:text="${line2}"></div> |
|
|
|
th:class="${iterStat2.index == 0} ? 'left-content' : 'right-content'" |
|
|
|
th:text="${line2}"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -266,7 +306,7 @@ |
|
|
|
<div class="informationText"> |
|
|
|
<div th:if="${#lists.size(trainingLines) > 0}" th:each="line1 : ${trainingLines}" class="multiLine-item"> |
|
|
|
<div th:each="line2,iterStat2:${line1}" |
|
|
|
th:class="${iterStat2.even} ? 'right-content' : 'left-content'" th:text="${line2}"></div> |
|
|
|
th:class="${iterStat2.index == 0} ? 'left-content' : 'right-content'" th:text="${line2}"></div> |
|
|
|
</div> |
|
|
|
<div th:if="${#lists.size(rwkMeetingList) > 0}" th:each="rwkMeeting : ${rwkMeetingList}" style="padding: 10px;width: 100%;"> |
|
|
|
<div style="font-size: 25px;" th:text="${rwkMeeting.meetingName}"></div> |
|
|
@@ -282,7 +322,7 @@ |
|
|
|
<div class="informationText"> |
|
|
|
<div th:if="${#lists.size(achievementLines) > 0}" th:each="line1 : ${achievementLines}" class="multiLine-item"> |
|
|
|
<div th:each="line2,iterStat2:${line1}" |
|
|
|
th:class="${iterStat2.even} ? 'right-content' : 'left-content'" th:text="${line2}"></div> |
|
|
|
th:class="${iterStat2.index == 0} ? 'left-content' : 'right-content'" th:text="${line2}"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -325,74 +365,131 @@ |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var prefix = ctx + "system/information"; |
|
|
|
rollingLinkage(); |
|
|
|
init(); |
|
|
|
//数据进行初始化加载 |
|
|
|
function init(){ |
|
|
|
// 初始化时设置第一个标题为激活状态 |
|
|
|
|
|
|
|
$(document).ready(function() { |
|
|
|
init(); |
|
|
|
rollingLinkage(); |
|
|
|
}); |
|
|
|
|
|
|
|
// 初始化 |
|
|
|
function init() { |
|
|
|
$('.sidebar .title').first().addClass('active'); |
|
|
|
// 初始化箭头位置 |
|
|
|
var arrow = $("#arrow"); |
|
|
|
arrow.css('top', $('.sidebar .title').first().position().top + 11); |
|
|
|
} |
|
|
|
|
|
|
|
function rollingLinkage(){ |
|
|
|
// 点击事件 |
|
|
|
function rollingLinkage() { |
|
|
|
var arrow = $("#arrow"); |
|
|
|
$('.sidebar .title').click(function() { |
|
|
|
const target = $(this).data('target'); |
|
|
|
const targetElement = $(target); |
|
|
|
let scrollPosition = 0; |
|
|
|
// 计算目标标签之前的所有兄弟标签的高度 |
|
|
|
targetElement.prevAll().each(function() { |
|
|
|
scrollPosition += parseInt($(this).css("height")); |
|
|
|
var content = $('#content'); |
|
|
|
var titles = $('.sidebar .title'); |
|
|
|
var sections = $('.section'); |
|
|
|
var sectionPositions = []; |
|
|
|
var isScrolling = false; // 添加标志位判断是否是点击导航触发的滚动 |
|
|
|
|
|
|
|
// 计算每个section的位置 |
|
|
|
function calculatePositions() { |
|
|
|
sectionPositions = []; |
|
|
|
sections.each(function() { |
|
|
|
var $section = $(this); |
|
|
|
var offsetTop = 0; |
|
|
|
// 计算相对于content的实际偏移量 |
|
|
|
$section.prevAll('.section').each(function() { |
|
|
|
offsetTop += $(this).outerHeight(true); |
|
|
|
}); |
|
|
|
|
|
|
|
sectionPositions.push({ |
|
|
|
id: $section.attr('id'), |
|
|
|
top: offsetTop, |
|
|
|
bottom: offsetTop + $section.outerHeight(true) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 初始计算位置 |
|
|
|
calculatePositions(); |
|
|
|
|
|
|
|
// 点击导航事件 |
|
|
|
titles.click(function() { |
|
|
|
var targetId = $(this).data('target').substring(1); // 移除#号 |
|
|
|
var targetPosition = 0; |
|
|
|
|
|
|
|
// 查找目标section的位置 |
|
|
|
sectionPositions.forEach(function(section) { |
|
|
|
if (section.id === targetId) { |
|
|
|
targetPosition = section.top; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 更新导航状态 |
|
|
|
titles.removeClass('active'); |
|
|
|
$(this).addClass('active'); |
|
|
|
|
|
|
|
// 更新箭头位置 |
|
|
|
arrow.css('top', $(this).position().top + 11); |
|
|
|
|
|
|
|
// 设置滚动标志 |
|
|
|
isScrolling = true; |
|
|
|
|
|
|
|
// 平滑滚动到目标位置 |
|
|
|
content.animate({ |
|
|
|
scrollTop: targetPosition |
|
|
|
}, 300, function() { |
|
|
|
// 滚动完成后重置标志 |
|
|
|
setTimeout(function() { |
|
|
|
isScrolling = false; |
|
|
|
}, 50); |
|
|
|
}); |
|
|
|
// 移动箭头 |
|
|
|
const newArrowPosition = $(this).position().top + 11; // 更新箭头位置 |
|
|
|
arrow.css('top', newArrowPosition); // 更新箭头位置 |
|
|
|
$('.sidebar .title').removeClass('active'); // 移除所有标题的选中状态 |
|
|
|
$(this).addClass('active'); // 设置当前标题为选中状态 |
|
|
|
// 滚动左侧区域到目标内容 |
|
|
|
$('#content').animate({ |
|
|
|
scrollTop: scrollPosition |
|
|
|
}, 300); // 动画效果 |
|
|
|
}); |
|
|
|
|
|
|
|
// 滚动事件 |
|
|
|
$('#content').scroll(function() { |
|
|
|
var scrollTop = $(this).scrollTop(); |
|
|
|
var titles = $('.sidebar .title'); |
|
|
|
var contentHeight = $('#content').height(); |
|
|
|
var contentScrollHeight = $('#content')[0].scrollHeight; |
|
|
|
var lastTitle = titles.last(); |
|
|
|
content.scroll(function() { |
|
|
|
// 如果是点击导航触发的滚动,不处理 |
|
|
|
if (isScrolling) return; |
|
|
|
|
|
|
|
titles.each(function() { |
|
|
|
var target = $(this).data('target'); |
|
|
|
var targetElement = $(target); |
|
|
|
var targetTop = targetElement.position().top; |
|
|
|
var targetHeight = targetElement.outerHeight(); |
|
|
|
var scrollTop = $(this).scrollTop(); |
|
|
|
var contentHeight = $(this).height(); |
|
|
|
var scrollPosition = scrollTop + (contentHeight * 0.3); // 使用30%视口高度作为触发点 |
|
|
|
|
|
|
|
if (scrollTop >= targetTop && scrollTop < targetTop + targetHeight) { |
|
|
|
titles.removeClass('active'); |
|
|
|
$(this).addClass('active'); |
|
|
|
// 移动箭头 |
|
|
|
var newArrowPosition = $(this).position().top + 11; |
|
|
|
arrow.css('top', newArrowPosition); |
|
|
|
return false; // 停止遍历 |
|
|
|
// 找到当前滚动位置对应的section |
|
|
|
var currentSection = null; |
|
|
|
|
|
|
|
sectionPositions.forEach(function(section) { |
|
|
|
if (scrollPosition >= section.top && scrollPosition < section.bottom) { |
|
|
|
currentSection = section.id; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 如果滚动到底部且最后一个标题未被激活,则激活最后一个标题 |
|
|
|
if (scrollTop + contentHeight >= contentScrollHeight - 10) { |
|
|
|
// 如果滚动到底部,激活最后一个导航 |
|
|
|
if (scrollTop + contentHeight >= content[0].scrollHeight - 20) { |
|
|
|
currentSection = sections.last().attr('id'); |
|
|
|
} |
|
|
|
|
|
|
|
// 更新导航状态 |
|
|
|
if (currentSection) { |
|
|
|
titles.removeClass('active'); |
|
|
|
lastTitle.addClass('active'); |
|
|
|
// 移动箭头 |
|
|
|
var newArrowPosition = lastTitle.position().top + 11; |
|
|
|
arrow.css('top', newArrowPosition); |
|
|
|
var activeTitle = titles.filter('[data-target="#' + currentSection + '"]'); |
|
|
|
activeTitle.addClass('active'); |
|
|
|
arrow.css('top', activeTitle.position().top + 11); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 监听窗口大小变化,重新计算位置 |
|
|
|
$(window).resize(function() { |
|
|
|
calculatePositions(); |
|
|
|
}); |
|
|
|
|
|
|
|
// 监听内容变化 |
|
|
|
var observer = new MutationObserver(function() { |
|
|
|
calculatePositions(); |
|
|
|
}); |
|
|
|
|
|
|
|
// 观察content内容变化 |
|
|
|
observer.observe(content[0], { |
|
|
|
childList: true, |
|
|
|
subtree: true, |
|
|
|
characterData: true |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |