網站的引導頁是給訪客的第一印象,好的引導頁能清楚傳達核心資訊。本文分享一款以 jQuery 打造的引導頁,搭配從右側優雅滑出的彈出式導航選單,並可隨時關閉收起。
效果展示:
https://hovertree.com/texiao/layer/3/
手機掃描二維碼體驗:
效果圖:
本特效適合作為網站引導頁,滑鼠移入時導航會從右側傾斜滑出,背景建議選用較深色的圖片以突顯前景。它同時支援行動裝置,讓手機使用者也能獲得良好體驗。
核心邏輯透過 jQuery 的 animate() 控制導航面板的展開與收合:
$(document).ready(function(){
function anim(duration){
$('#hovertreemin').animate({height: 'toggle'}, {duration: duration});
}
$('#hovertreeclose').on("mouseover",function() {
$('#hovertreeminbar').hide();
anim(60);
});
$('#hovertreemin').on("click", function () {
anim(60);
$('#hovertreeminbar').show();
});
});導航面板 #hovertreemin 內含選單列表、聯絡資訊與裝飾圖片,預設隱藏並定位於頁面右上角;點擊觸發後才會滑出:
<div id="hovertreemin" style="display:none;position:absolute;top:0;right:0px;">
<ul class="box-nav">
<li><a href="...">關於我們</a></li>
<li><a href="...">產品展示</a></li>
<li><a href="...">新聞中心</a></li>
</ul>
</div>源碼下載:
https://hovertree.com/h/bjaf/yindaodaohang.htm
來源:何問起