Anglar js选项卡
来源:互联网 发布:js删除数组指定下标 编辑:程序博客网 时间:2024/06/05 21:59
<!DOCTYPE html><html lang="en" ng-app="myApp"><head> <meta charset="UTF-8"> <title>选项卡</title> <style> * { margin: 0; padding: 0; } #uu { list-style: none; margin: 0 auto; width: 850px; } #uu li { width: 200px; height: 40px; line-height: 40px; border: 1px solid black; float: left; margin: 5px; text-align: center; } #d2 { width: 800px; height: 400px; border: 1px solid black; overflow: hidden; clear: both; margin: 0 auto; position: relative; } #d2 p { position: absolute; top: 0; left: 0; } .btn_in { background: blue; } .ll { background-color: lightgreen; } .p1 { display: none; } .sho { display: block; } </style> <script src="js/angular.min.js"></script> <script> var app = angular.module("myApp", []); app.controller("Deom", ["$scope", function($scope) { $scope.selected = 0;//默认选中第一个 $scope.list = [{title:"列表一"},{title:"列表二"},{title:"列表三"},{title:"列表四"}]; $scope.text = ["第一", "第二", "第三", "第四"]; $scope.show = function(i) { $scope.selected = i; } }]); </script></head><body ng-app="myApp"> <div ng-controller="Deom"> <ul id="uu" ng-repeat="t in list"><!--重复--> <!--ng-click="show($index)"切换选中的选项卡--> <li ng-class="{ll: $index==selected}" ng-click="show($index)">{{t.title}}</li> </ul> <div id="d2"> <p ng-repeat="c in text" class="p1" ng-class="{sho: $index==selected}"> {{c}} </p> </div> </div></body></html>
阅读全文
0 0
- Anglar js选项卡
- anglar js 做复选框
- Anglar js 的一些基本指令
- js 拖动选项卡
- JS选项卡
- JS选项卡
- js选项卡
- JS通用选项卡
- JS简单选项卡
- js选项卡
- js的选项卡
- js选项卡
- JS选项卡
- js选项卡
- js 选项卡实现
- js选项卡制作
- 纯 js 选项卡
- js选项卡制作
- NOIP2017 复赛游记
- 音视频相关文章查阅资料汇总篇-后期不断完善更新
- NOIP2003 加分二叉树
- opencv学习笔记三
- 走啦
- Anglar js选项卡
- 论网站更新与seo优化的关系
- Xcode9学习笔记48
- 一分钟实现分布式锁
- Windows下tensorflow安装 win64+Python3.5
- 模板整理: 图论---二分图匹配
- 左移位和右移位
- 019 矩阵对角化
- NOIP模拟 路径统计 【弗洛伊德算法】