路由

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="angular-1.3.0.js"></script>
    <script src="angular-route.js"></script>
    <script src="jquery-1.11.0.js"></script>
    <style>
        li{
            list-style: none;
            margin: 10px;

        }
        a{
            text-decoration-line: none;
        }
    </style>
    <script>

        var app=angular.module("myApp",["ngRoute"]);
                app.config(["$routeProvider",function ($routeProvider) {
                    $routeProvider
                        .when("/index",{templateUrl:"周考二.html"})
                        .when("/name",{template:"<div style='margin-left: 450px;width: 700px;height: 400px'><ul><li style='background-color: cornflowerblue'>和琪</li><li>张三</li><li>李四</li></ul></div>"})
                        .when("/dz",{template:"<div style='margin-left: 450px;width: 700px;height: 400px'><ul><li style='background-color: cornflowerblue'>上地一街</li><li>上地二街</li><li>上地三街</li></ul></div>"})
                        .otherwise({template:"<div style='margin-left: 450px;width: 700px;height: 400px'><h2>找不到网页啦!</h2></div>"});

                }]);




        $(function () {
            $("#d1").click(function () {
                $("#d1").css("background-color","cornflowerblue");
                $("#d1").css("color","white");
                $("#d2").css("background-color","white");
                $("#d3").css("background-color","white");
            })
            $("#d2").click(function () {
                $("#d1").css("background-color","white");
                $("#d2").css("background-color","cornflowerblue");
                $("#d3").css("background-color","white");
            })
            $("#d3").click(function () {
                $("#d1").css("background-color","white");
                $("#d2").css("background-color","white");
                $("#d3").css("background-color","cornflowerblue");
            })
        })


    </script>
</head>
<body ng-app="myApp">
    <div style="">
        <div style="float:left;margin: 10px"id="d1"><a href="#index">商品列表</a></div>
        <div style="float:left;margin:10px" id="d2"><a href="#name">用户信息</a></div>
        <div style="float: left;margin: 10px"id="d3"><a href="#dz">地址信息</a></div>
    </div>
    <div style="clear: both;"></div>
    <ng-view></ng-view>
</body >
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值