简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.bootcss.com/foundation/5.5.3/css/foundation.min.css"> <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/foundation/5.5.3/js/foundation.min.js"></script> <script src="https://cdn.bootcss.com/foundation/5.5.3/js/vendor/modernizr.js"></script> <style> .tabs-content > .content.active { -webkit-animation: fadeEffect 1s; animation: fadeEffect 1s; } @-webkit-keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} } @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} } </style> <div style="padding:10px"> <h2>淡入切换选项卡</h2> <ul class="tabs" data-tab> <li class="tab-title active"><a href="#home">主页</a></li> <li class="tab-title"><a href="#menu1">菜单 1</a></li> <li class="tab-title"><a href="#menu2">菜单 2</a></li> <li class="tab-title"><a href="#menu3">菜单 3</a></li> </ul> <div class="tabs-content"> <div class="content active" id="home"> <h3>HOME</h3> <p>简单教程</p> </div> <div class="content" id="menu1"> <h3>菜单 1</h3> <p>简单教程 1</p> </div> <div class="content" id="menu2"> <h3>菜单 2</h3> <p>简单教程 2</p> </div> <div class="content" id="menu3"> <h3>菜单 3</h3> <p>简单教程 3</p> </div> </div> </div> <script> $(document).ready(function() {$(document).foundation();}) </script>
运行结果: