7. todoList待办事情列表(js本地存储)

  1. 功能
    7. todoList待办事情列表(js本地存储)_第1张图片

  2. css代码

    *{
           
        padding:0;
        margin:0;
    }
    ul{
           
        list-style: none;
    }
    ol{
           
        list-style: none;
    }
    body{
           
        background-color: #cdcdcd;
    }
    h2{
           
        margin:20px 0;
        position: relative;
    }
    h2 span{
           
        height: 20px;
        width: 20px;
        background-color: #E6E6FA;
        border-radius: 50%;
        position: absolute;
        font-size:16px;
        right: 0;
        text-align: center;
        line-height: 20px;
        color:#666;
    }
    .container{
           
        width:600px;
        margin: 0 auto;
    
    }
    .f_left{
           
        float: left;
    }
    .f_right{
           
        float: right;
    }
    .title{
           
        background-color: rgba(47, 47, 47, 0.98);
        height: 50px;
    }
    .title span{
           
        font-size:25px;
        color:#ddd;
        line-height: 50px;
        display: block;
    }
    .title input{
           
        border: none;
        height: 25px;
        width: 360px;
        border-radius: 5px;
        margin-top:12px;
        text-indent: 1em;
        box-shadow: 1px 1px 6px 0 #999 inset;
    }
    li{
           
        position: relative;
        border-left: 5px solid  #629A9C;
        border-radius:2px;
        background-color: #fff;
        padding:5px 0;
        margin-top:15px;
    }
    li p {
           
        margin-left: 40px;
        margin-right: 40px;
    }
    li .final{
           
        height: 22px;
        width: 22px;
        position: absolute;
        left: 10px;
    }
    li .del{
           
        position: absolute;
        right: 10px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border:6px double #fff;
        top:2px;
        background-color: #ccc;  
        cursor:pointer;      
    }
    .final_list li{
           
        border-left-color: #999;
        background-color: #fff;
        opacity: 0.5;
    }
    
  3. HTML代码

    <div class="title">
        <div class="container">
            <span class="f_left">ToDoListspan><input type="text" name="title" id="title" class="f_right" placeholder="添加todo">
        div>
    div>
    <div class="container">
        <h2>正在进行 <span class="todo_num">0span>h2>
        <ul class="todo_list">
        ul>
    div>
    <div class="container">
        <h2>已经完成 <span class="final_num">0span>h2>
        <ol class="final_list">
            
        ol>
    div>
    
  4. js代码(需要引用jquery)

你可能感兴趣的:(#,JavaScript,js,jquery,javascript)