-
Notifications
You must be signed in to change notification settings - Fork 5
/
js.php
35 lines (28 loc) · 1005 Bytes
/
js.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!-- 引入jquery -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script>
// 控制side-bar開關
$("#sideBarController").click(function() {
$("#sideBar").toggleClass("sideBarToggle");
})
$(document).ready(function() {
function checkWidth() {
if ($(window).width() > 1200) {
$('#sideBar').removeClass('sideBarToggle');
} else {
$('#sideBar').addClass('sideBarToggle');
}
}
// 初次加載時檢查一次寬度
checkWidth();
// 當視窗大小改變時,執行檢查
$(window).resize(checkWidth);
});
//控制side-bar內按鈕的收合
$("#adminBtn").click(function() {
$("#adminList").toggleClass("adminToggle")
})
$("#storeBtn").click(function() {
$("#storeList").toggleClass("storeToggle")
})
</script>