zoukankan      html  css  js  c++  java
  • document.writeln绑定数据 --点击跳转添加样式

    document.writeln(" <div class='flex-model'>");
    document.writeln(" <div class='container'>");
    document.writeln(" <div class='footer'>");
    document.writeln(" <a href='order.html'>");
    document.writeln(" <p class='icon icon1'>

    ");
    document.writeln(" <p class='order'>订单

    ");
    document.writeln(" ");
    document.writeln(" <a href='saleAfterSelf.html'>");
    document.writeln(" <p class='icon icon2'>

    ");
    document.writeln(" <p class='income'>售后

    ");
    document.writeln(" ");
    document.writeln(" <a href='income.html'>");
    document.writeln(" <p class='icon icon3'>

    ");
    document.writeln(" <p class='goods'>收支

    ");
    document.writeln(" ");
    document.writeln(" <a href='goods.html'>");
    document.writeln(" <p class='icon icon4'>

    ");
    document.writeln(" <p class='goods'>商品

    ");
    document.writeln(" ");
    document.writeln(" <a href='my.html'>");
    document.writeln(" <p class='icon icon5'>

    ");
    document.writeln(" <p class='my'>我

    ");
    document.writeln(" ");
    document.writeln(" ");
    document.writeln("");
    document.writeln(" ");
    document.writeln(" ");
    $(function () {
    // var storage=window.localStorage;
    getItem();
    function getItem(){
    var temp = localStorage.getItem('temp');
    if(temp != null){
    if(temp == 1){
    $(".footer a[href ='order.html']").addClass('active').siblings().removeClass('active');
    }else if(temp == 2){
    $(".footer a[href ='saleAfterSelf.html']").addClass('active').siblings().removeClass('active');
    }else if(temp == 3){
    $(".footer a[href ='income.html']").addClass('active').siblings().removeClass('active');
    }else if(temp 4){
    $(".footer a[href ='goods.html']").addClass('active').siblings().removeClass('active');
    }else if(temp 5){
    $(".footer a[href ='my.html']").addClass('active').siblings().removeClass('active');
    }
    }
    };
    $(".footer a").click(function(){
    //alert(1111);
    var href= $(this).attr('href');
    if (href == 'order.html'){
    localStorage.setItem('temp',1);
    }else if(href == 'saleAfterSelf.html' || href == 'returnsAfterSelf.html' || href == 'saleAfterOffter.html' || href 'returnsAfterOffter.html' || href == 'saleAfterSupply.html' || href'returnsAfterSupply.html' || href
    'saleAfterExperience.html' || href
    'returnsAfterExperience.html'){
    localStorage.setItem('temp',2);
    }else if(href == 'income.html'){
    localStorage.setItem('temp',3);
    }else if(href == 'goods.html'){
    localStorage.setItem('temp',4);
    }else if(href == 'my.html'){
    localStorage.setItem('temp',5);
    }
    //$(this).attr("color","red");
    $(this).addClass('active').siblings().removeClass();
    });

    });

    最难就是坚持
  • 相关阅读:
    Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录
    bypass disable_function的方法及蚁剑插件bypass-php-function使用
    cisco-GNS3-pix防火墙基本配置实操(持续更新)
    "锁定文件失败 打不开磁盘或它所依赖的某个快照磁盘。模块启动失败。未能启动虚拟机"--解决方法
    python实现图片转字符画
    GNS3--cisco路由器NAT配置
    python虚拟环境----virtualenv
    防火墙----思科路由器基本配置1
    XXE漏洞学习1
    vc程序设计-----位图
  • 原文地址:https://www.cnblogs.com/pp-air/p/7479083.html
Copyright © 2011-2022 走看看