2024/01/16 caption 추가

This commit is contained in:
kmg 2024-01-16 16:56:11 +09:00
parent 91a7fae0be
commit f289cdfdc1

View File

@ -1067,3 +1067,42 @@ $(function(){
/* 날짜 및 시간 입력 시 자동 작성 스크립트 */ /* 날짜 및 시간 입력 시 자동 작성 스크립트 */
$(document).ready(function () {
boardCaptionToggle();
boardCaptionToggle02();
});
function boardCaptionToggle() {
var bdWid = $("body").width();
var thLength = $(".tb_type01 th").length;
if (bdWid > 640) {
var subTit = $(".tb_tit01_left p").text()
var itmText = "";
$(".tb_type01 th").each(function (index, item) {
itmText += $(item).text();
if (index === thLength - 1) {
/* 마지막 th일 경우 - ,가 들어가면 안됨. */
itmText;
} else {
itmText += ", ";
}
});
if ($(".tb_type01 caption").length == 0) {
if(subTit.indexOf("목록") != -1){
$(".tb_type01>table").prepend("<caption>" + subTit + " : " + itmText + "등의 정보제공 </caption>");
}else{
if(subTit == "대시보드"){
$(".tb_type01>table").prepend("<caption> : " + itmText + "등의 정보제공 </caption>");
}else{
$(".tb_type01>table").prepend("<caption>" + subTit + " 목록 : " + itmText + "등의 정보제공 </caption>");
}
}
} else {}
} else {
$(".tb_type01 caption").remove();
}
}