tab栏:
代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Tab 标签</title> <style> body { margin: 0; padding: 0; background-color: #F7F7F7; } .tabs { width: 400px; margin: 30px auto; background-color: #FFF; border: 1px solid #C0DCC0; box-sizing: border-box; } img { width: 400px; } .tabs nav { height: 40px; text-align: center; line-height: 40px; overflow: hidden; background-color: #C0DCC0; display: flex; } nav a { display: block; width: 100px; border-right: 1px solid #FFF; color: #000; text-decoration: none; } nav a:last-child { border-right: 0 none; } nav a.active { background-color: #9BAF9B; } .cont { overflow: hidden; /*display: none;*/ } .cont ol { line-height: 30px; } p { text-align: center; height: 30px; line-height: 30px; } li { list-style: none; height: 30px; line-height: 30px; } </style> <!--[if lte IE 6]> <![endif]--> </head> <body ng-app="Tabs"> <div class="tabs" ng-controller="TabsController"> <nav> <!-- 指令之间没有分号 --> <a href="javascript:;" ng-class="{active: type == 'local'}" ng-mouseover="switch('local')">白山茶</a> <a href="javascript:;" ng-class="{active: type == 'global'}" ng-mouseover="switch('global')">作曲</a> <a href="javascript:;" ng-class="{active: type == 'sports'}" ng-mouseover="switch('sports')">背景</a> <a href="javascript:;" ng-class="{active: type == 'funny'}" ng-mouseover="switch('funny')">歌词</a> </nav> <div ng-switch on="type"> <section class="cont" ng-switch-when="local"> <p>2017.5.24</p> </section> <section class="cont" ng-switch-when="global"> <p>作曲:陈雪凝</p> <p>作词:陈雪凝</p> <p>编曲:海艺音乐</p> </section> <section class="cont" ng-switch-when="sports"> <img src="/UploadFiles/2021-04-02/bsc.png">mvc小案例:
代码:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Template "stylesheet" href="css/base.css"> --> <link rel="stylesheet" href="css/index.css"> <!-- CSS overrides - remove if you don't need it --> <link rel="stylesheet" href="css/app.css"> </head> <body ng-app="Todos"> <section class="todoapp" ng-controller="TodoController"> <header class="header"> <h1>todos</h1> <form ng-submit="add()"> <!-- 用户输入点 --> <input class="new-todo" placeholder="What needs to be done" ng-model="text" autofocus> </form> </header> <section class="main"> <input class="toggle-all" type="checkbox"> <label for="toggle-all">Mark all as complete</label> <ul class="todo-list"> <li ng-repeat="(key,todo) in todos"> <div class="view"> <input type="checkbox" class="toggle" ng-click="done(key)" > <label>{{todo.text}}</label> <button class="destroy" ng-click="delete(todos,key)" ></button> </div> <input class="edit" value="Create a TodoMVC template"> </li> <li><h5>已完成</h5></li> <li class="completed" ng-repeat="todo in doneTodos"> <div class="view"> <input class="toggle" type="checkbox" ng-checked="todo.flag" > <label>{{todo.text}}</label> <button class="destroy" ng-click="delete(doneTodos,key)"></button> </div> <input class="edit" value="Rule the web"> </li> </ul> </section> <footer class="footer"> <span class="todo-count"><strong></strong> {{todos.length}} item left</span> <button class="clear-completed">Clear completed</button> </footer> </section> <footer class="info"> <p>Double-click to edit a todo</p> <p>Template by <a href="http://sindresorhus.com">Sindre Sorhus</a></p> <p>Created by <a href="http://todomvc.com">you</a></p> <p>Part of <a href="http://todomvc.com">TodoMVC</a></p> </footer> </body> <script src="/UploadFiles/2021-04-02/angular.min.js">以上所述是小编给大家介绍的AngularJS tab栏实现和mvc小案例实例详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
标签:
angularjs,tab
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“AngularJS tab栏实现和mvc小案例实例详解”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。