DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> WEB網站前端 >> 網頁特效代碼 >> jQuery移動端頁面側邊導航滑入效果
jQuery移動端頁面側邊導航滑入效果
編輯:網頁特效代碼     

效果體驗:http://hovertree.com/texiao/mobile/2.htm

可以使用移動設備浏覽器查看效果。
效果使用到jquery-2.1.4.min.js,該版本的jQuery庫是用於支持HTML5的浏覽器上,不再兼容IE8以前的浏覽器,現在移動端浏覽器一般都支持HTML5,所以使用該jQuery沒問題。

HTML文件代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<title>移動端頁面側邊導航滑入效果 - HoverTree</title><base target="_blank" />
<script src="http://hovertree.com/ziyuan/jquery/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="http://hovertree.com/texiao/mobile/2/hvtmoblilecss2.css">
<style>a{color:white}</style>
</head>
<body>

<div class="wrapperhovertree">
<div class="container">
<header>
<h1><a href="javascript:;" class="slide-menu" target="_self"><img src="http://hovertree.com/texiao/mobile/2/menu.png" alt=""></a>HoverTree Menu</h1>
</header>
<div class="imgbox">
<div>請點擊左上角圖標,菜單將從左側滑出。<a href="http://hovertree.com">首頁</a> <a href="http://hovertree.com/hvtart/bjae/i1qo2kg6.htm">原文</a> <a href="http://hovertree.com/texiao/">特效庫</a></div>
<img src="http://hovertree.com/texiao/mobile/2/img1.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img2.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img3.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img4.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img5.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img6.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img7.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img8.jpg" alt="">
<img src="http://hovertree.com/texiao/mobile/2/img9.jpg" alt="">
</div>
</div>
</div>

<!-- 側邊導航 -->
<div class="slide-mask"></div>
<aside class="slide-wrapper">
<div>
<div>
<strong>HoverTree</strong>
</div>
<ul>
<li><a href="http://hovertree.com/menu/jquery/">jQuery</a></li>
<li><a href="http://hovertree.com/menu/javascript/">JavaScript</a></li>
<li><a href="http://hovertree.com/menu/html5">HTML5</a></li>
<li><a href="http://hovertree.com/menu/css">CSS</a></li>
<li><a href="http://hovertree.com/menu/mobile/">移動Web</a></li>
<li><a href="http://hovertree.com/menu/texiao/">網頁特效</a></li>
<li><a href="http://tool./">工具</a></li>
<li><a href="http:///"></a></li>
<li><a href="http://hovertree.com/guestbook/">留言</a></li>
</ul>
</div>
</aside>
<footer>
hovertree.com 2014-2015
</footer>
<script>
$(function(){
$('aside.slide-wrapper').on('touchstart', 'li', function(e){
$(this).addClass('current').siblings('li').removeClass('current');
});

$('a.slide-menu').on('click', function(e){
var wh = $('div.wrapperhove'+'rtree').height();
$('div.slide-mask').css('height', wh).show();
$('aside.slide-wrapper').css('height', wh).addClass('moved');
});

$('div.slide-mask').on('click', function(){
$('div.slide-mask').hide();
$('aside.slide-wrapper').removeClass('moved');
});
});
</script>
</body>
</html>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved