select美化效果

代码语言:html

所属分类:表单美化

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>BFW NEW PAGE</title>
    <script id="bfwone" data="dep=jquery.17&err=0" type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
    <script type="text/javascript">
        bready(function() {
            $('.select').on('click', '.placeholder', function(e) {
                var parent = $(this).closest('.select');
                if (!parent.hasClass('is-open')) {
                    parent.addClass('is-open');
                    $('.select.is-open').not(parent).removeClass('is-open');
                } else {
                    parent.removeClass('is-open');
                }
                e.stopPropagation();
            }).on('click',
                'ul>li',
                function() {
                    var parent = $(this).closest('.select');
                    parent.removeClass('is-open').find('.placeholder').text($(this).text());
                });

            $('body').on('click',
                function() {
                    $('.select.is-open').removeClass('is-open');
                });

        });
    </script>
    <link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
    <style>

        html {
            box-sizing: inherit;
            background-color: #8e9eab;
            background: linear-gradient(toleft, #8e9eab, #eef2f3);
        }
        body {
            margin: 20% auto;
            font-size: 12px;
        }
        .select {
            position: relative;
            display: block;
            margin: 0 auto;
            width: 100%;
            max-width: 225px;
            color: #cccccc;
            vertical-align: middle;
            tex.........完整代码请登录后点击上方下载按钮下载查看

网友评论0