Skip to content

Commit 57f64de

Browse files
authored
Update index.html
1 parent b9b58d2 commit 57f64de

File tree

1 file changed

+53
-49
lines changed

1 file changed

+53
-49
lines changed

index.html

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -394,55 +394,59 @@
394394
justify-content:center;
395395
}
396396

397-
#diamond-sponsor-carousel{
398-
width:100%;
399-
max-width: 1100px; /* 让两张卡并排更舒服 */
400-
position: relative;
401-
}
402-
403-
#diamond-sponsor-carousel .diamond-slide{
404-
padding: 10px;
405-
}
406-
407-
/* Owl nav buttons (arrows) */
408-
#diamond-sponsor-carousel .owl-nav button{
409-
position:absolute;
410-
top: 45%;
411-
transform: translateY(-50%);
412-
width: 44px;
413-
height: 44px;
414-
border-radius: 999px;
415-
background: rgba(255,255,255,0.9) !important;
416-
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
417-
font-size: 26px !important;
418-
line-height: 44px !important;
419-
margin: 0 !important;
420-
}
421-
422-
#diamond-sponsor-carousel .owl-nav .owl-prev{
423-
left: -14px;
424-
}
425-
#diamond-sponsor-carousel .owl-nav .owl-next{
426-
right: -14px;
427-
}
428-
429-
/* dots spacing */
430-
#diamond-sponsor-carousel .owl-dots{
431-
margin-top: 8px;
432-
}
433-
434-
/* Mobile: still 1 item */
435-
@media only screen and (max-width: 600px){
436-
#diamond-sponsor-carousel{
437-
max-width: 520px;
438-
}
439-
#diamond-sponsor-carousel .owl-nav .owl-prev{
440-
left: -8px;
441-
}
442-
#diamond-sponsor-carousel .owl-nav .owl-next{
443-
right: -8px;
444-
}
445-
}
397+
/* ✅ Right-peek only (desktop) */
398+
@media (min-width: 768px){
399+
/* 关键:把整个 stage 往左拉回去,抵消左侧露出 */
400+
#diamond-sponsor-carousel .owl-stage-outer{
401+
overflow: hidden; /* 默认就是 hidden,强调一下 */
402+
}
403+
#diamond-sponsor-carousel .owl-stage{
404+
margin-left: -70px; /* ✅ 这里要和 JS 里 stagePadding 一致 */
405+
}
406+
}
407+
408+
/* ✅ Arrows on the sides of the carousel (not below) */
409+
#diamond-sponsor-carousel{
410+
position: relative;
411+
}
412+
413+
/* owl 默认会把 nav 放在下面,这里强制绝对定位到两侧 */
414+
#diamond-sponsor-carousel .owl-nav{
415+
position:absolute;
416+
top: 50%;
417+
left: 0;
418+
right: 0;
419+
transform: translateY(-50%);
420+
pointer-events: none; /* 让容器不挡点击 */
421+
margin: 0 !important;
422+
}
423+
424+
#diamond-sponsor-carousel .owl-nav button{
425+
pointer-events: auto; /* 按钮可点击 */
426+
position:absolute;
427+
width: 44px;
428+
height: 44px;
429+
border-radius: 999px;
430+
background: rgba(255,255,255,0.92) !important;
431+
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
432+
font-size: 26px !important;
433+
line-height: 44px !important;
434+
margin: 0 !important;
435+
}
436+
437+
#diamond-sponsor-carousel .owl-nav .owl-prev{
438+
left: -18px; /* ✅ 位于卡片左侧 */
439+
}
440+
#diamond-sponsor-carousel .owl-nav .owl-next{
441+
right: -18px; /* ✅ 位于卡片右侧 */
442+
}
443+
444+
/* 小屏稍微收回来 */
445+
@media (max-width: 600px){
446+
#diamond-sponsor-carousel .owl-nav .owl-prev{ left: -10px; }
447+
#diamond-sponsor-carousel .owl-nav .owl-next{ right: -10px; }
448+
}
449+
446450

447451

448452
@media only screen and (max-width: 600px) {

0 commit comments

Comments
 (0)