select_sex.html 1.5 KB
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_782635_cvxdd8r2ec.css"/>
    <link rel="stylesheet" href="css/select_sex.css"/>
    <script src="js/base.js"></script>
    <title>选择性别</title>
</head>
<body>
<div class="container">
    <div class="sex_chose">
        <div class="girl">
            <img src="img/girl.png" alt=""/>
        </div>
        <div class="boy">
            <img src="img/boy.png" alt=""/>
        </div>
    </div>
    <div class="select_sex">
        <p class="woman">女生</p>
        <p class="man">男生</p>
    </div>
    <div class="select">
        <p class="sure">确定</p>
        <P class="cancel">取消</P>
    </div>
</div>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(".woman").click(function(){
        $(this).css("color","#F37A7B");
        $(this).css("background","rgba(243,122,123,0.6)");
        $(this).siblings(".man").css("color","#fff");
        $(this).siblings(".man").css("background","rgba(57,144,245,1)")
    })
    $(".man").click(function(){
        $(this).css("color","#3990F5");
        $(this).css("background","rgba(57,144,245,0.25)");
        $(this).siblings(".woman").css("color","#fff");
        $(this).siblings(".woman").css("background","rgba(243,122,123,1)")
    })
    //取消
    $(".cancel").click(function(){
        window.history.back()
    })
</script>
</body>
</html>