diff --git a/jpg/11.jpg b/jpg/11.jpg new file mode 100644 index 0000000..2905d97 Binary files /dev/null and b/jpg/11.jpg differ diff --git a/jpg/12.jpg b/jpg/12.jpg new file mode 100644 index 0000000..e0c5e4d Binary files /dev/null and b/jpg/12.jpg differ diff --git a/jpg/13.jpg b/jpg/13.jpg new file mode 100644 index 0000000..3897dac Binary files /dev/null and b/jpg/13.jpg differ diff --git a/jpg/14.jpg b/jpg/14.jpg new file mode 100644 index 0000000..7b9cc3f Binary files /dev/null and b/jpg/14.jpg differ diff --git a/jpg/15.jpg b/jpg/15.jpg new file mode 100644 index 0000000..e31be30 Binary files /dev/null and b/jpg/15.jpg differ diff --git a/script.js b/script.js index 1e4c970..4c7742d 100644 --- a/script.js +++ b/script.js @@ -35,9 +35,9 @@ $(document).ready(function() { $(".tab").find(".addTab").before(newTabButton); $("body").append(newTabContent); - // 绑定新添加的选项卡按钮和删除按钮的事件 bindTabEvents(); + updateContentOpacity(slider.val()); }); // 删除选项卡 @@ -51,7 +51,6 @@ $(document).ready(function() { // 删除当前标签页 $("#" + tabName).remove(); $("button[data-tab='" + tabName + "']").remove(); - // 如果删除的是当前活动的标签页 if (tabName === activeTab) { // 显示上一个标签页 @@ -277,15 +276,19 @@ $(document).ready(function() { $(document).ready(function() { const slider = $('#mySlider'); const sliderValue = $('#sliderValue'); - + //const content = $('.tabcontent'); // 初始化显示滑块的值 sliderValue.text(slider.val()); - + updateContentOpacity(slider.val()); // 监听滑块值的变化 slider.on('input', function() { - sliderValue.text(slider.val()); - }); + const value = slider.val(); + sliderValue.text(value); + updateContentOpacity(value);}); }); + function updateContentOpacity(value) { + $('.tabcontent').css('--content-opacity', value / 100); + } }); $(document).ready(function() { $('#closeButton').click(function() { diff --git a/styles.css b/styles.css index 47ee818..a6a898b 100644 --- a/styles.css +++ b/styles.css @@ -1,7 +1,8 @@ -/* 选项卡按钮样式 */ -.tabcontent { - text-align: center; /* 使“日期”居中显示 */ +:root { + --content-opacity: 0.5; /* 定义透明度变量 */ } + +/* 选项卡按钮样式 */ .tab { overflow: hidden; border: 1px solid #ff69b4; /* 粉色边框 */ @@ -45,11 +46,12 @@ /* 选项卡内容样式 */ .tabcontent { + text-align: center; /* 使“日期”居中显示 */ display: none; padding: 6px 12px; border: 1px solid #ff69b4; /* 粉色边框 */ border-top: none; - background-color: #fff; /* 白色背景 */ + background-color: rgba(255, 255, 255, var(--content-opacity)); /* 白色背景 */ } /* 删除按钮样式 */ @@ -71,7 +73,7 @@ img{height: auto; width: auto\9; width:28%;} .cldBody { - background: #f7f7f7; + background-color: rgba(255, 255, 255, var(--content-opacity)); width: 420px; margin: 10px auto; } @@ -93,9 +95,10 @@ td { line-height: 60px; text-align: center; font-size: 20px; + background-color: rgba(255, 255, 255, var(--content-opacity)); } #tbody td:hover { - background: #ededed; + background: rgba(30, 30, 30, 0.2); cursor: pointer; } .curDate {