http://healthunit.com從手機設備查看後,屏幕頂部會出現一個乾淨的水平滾動菜單。我試圖模仿相同的確切功能,這要歸功於我正在重新設計具有巨大導航元素級別的網站。響應式水平滾動菜單
要求:
- 左,右滾動單擊選項 在空間中心
- 只有一個列表項可見在同一時間
- 中心列表項選項
- 水平滾動&響應
- 點擊列表中的最後一個或第一個選項將帶您到列表中的第一個選項或最後一個選項
我給這部分當前的HTML是:
<nav id="sub" class="clearfix">
<ul class="wrapper">
<a href="#"><li>Estimate</li></a>
<a href="#"><li>About</li></a>
<a href="#"><li>Customer Information</li></a>
<a href="#"><li>Financing</li></a>
<a href="#"><li>Careers</li></a>
<a href="#"><li>Locate Us</li></a>
<a href="#"><li>Inspiration</li></a>
</ul>
</nav>
當前連接到它的CSS是:
nav#sub {
background: #004173;
background: linear-gradient(to bottom, #004173 0%,#014f8d 100%);
background: -moz-linear-gradient(top, #004173 0%, #014f8d 100%);
background: -ms-linear-gradient(top, #004173 0%,#014f8d 100%);
background: -o-linear-gradient(top, #004173 0%,#014f8d 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#004173), color-stop(100%,#014f8d));
background: -webkit-linear-gradient(top, #004173 0%,#014f8d 100%);
border-bottom: #00325a solid 3px;
box-shadow: 0 4px 6px 0 #BFBFBF;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#004173', endColorstr='#014f8d',GradientType=0);
webkit-box-shadow: 0 4px 6px 0 #BFBFBF;
}
#sub ul {
text-align: center;
}
#sub ul li {
padding: 10px 3.3%;
}
#sub a {
color: #fff;
font-size: 10pt;
font-weight: 400;
text-decoration: none;
}
#sub ul a:hover li {
background: #007FEB;
}
你想讓它通過左右滾動或2個按鈕來控制嗎(「<" and ">」)? (...或者兩者兼而有之?) –
嗨Stefan,我的目標是用左右兩個按鈕(< and >)控制它。 – Cutter
你可能想添加一些你想要幫助的具體細節:)。 – Blunderfest