使用CSS3的treeview在ie10中不起作用

时间:2015-03-03 14:16:22

标签: html css css3 treeview

我有一个系统,我在树视图中动态查询数据库创建节点。

以下代码创建了一个没有javascript的树视图,它在Chrome和Firefox中运行良好,但在IE10中无效。

treehome.php:

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="treestyle.css">
    </head>
<body>
<div class="acidjs-css3-treeview">
    <ul>
        <li>
            <input type="checkbox" id="node-0" checked="checked" /><label><input type="checkbox" /><span></span></label><label for="node-0">Libraries</label>
            <ul>
                <li>
                    <input type="checkbox" id="node-0-0" checked="checked" /><label><input type="checkbox" /><span></span></label><label for="node-0-0">Documents</label>
                    <ul>
                        <li>
                            <input type="checkbox" id="node-0-0-0" checked="checked" /><label><input type="checkbox" /><span></span></label><label for="node-0-0-0">My Documents</label>
                            <ul>
                                <li>
                                    <input type="checkbox" id="node-0-0-0-0" /><label><input type="checkbox" /><span></span></label><label for="node-0-0-0-0">Downloads</label>
                                </li>
                                <li>
                                    <input type="checkbox" id="node-0-0-0-1" /><label><input type="checkbox" /><span></span></label><label for="node-0-0-0-1">Projects</label>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li>
                    <input type="checkbox" id="node-0-1" /><label><input type="checkbox" /><span></span></label><label for="node-0-1">Music</label>
                    <ul>
                        <li>
                            <input type="checkbox" id="node-0-1-0" /><label><input type="checkbox" /><span></span></label><label for="node-0-1-0">My Music</label>
                        </li>
                        <li>
                            <input type="checkbox" id="node-0-1-1" /><label><input type="checkbox" /><span></span></label><label for="node-0-1-1">Public Music</label>
                        </li>
                    </ul>
                </li>
                <li>
                    <input type="checkbox" id="node-0-2" /><label><input type="checkbox" /><span></span></label><label for="node-0-2">Pictures</label>
                    <ul>
                        <li>
                            <input type="checkbox" id="node-0-2-0" /><label><input type="checkbox" /><span></span></label><label for="node-0-2-0">My Pictures</label>
                        </li>
                        <li>
                            <input type="checkbox" id="node-0-2-1" /><label><input type="checkbox" /><span></span></label><label for="node-0-2-1">Public Pictures</label>
                        </li>
                    </ul>
                </li>
                <li>
                    <input type="checkbox" id="node-0-3" checked="checked" /><label><input type="checkbox" checked="checked" /><span></span></label><label for="node-0-3">Video</label>
                    <ul>
                        <li>
                            <input type="checkbox" id="node-0-3-0" /><label><input type="checkbox" checked="checked" /><span></span></label><label for="node-0-3-0">My Videos</label>
                        </li>
                        <li>
                            <input type="checkbox" id="node-0-3-1" /><label><input type="checkbox" checked="checked" /><span></span></label><label for="node-0-3-1">Public Videos</label>
                        </li>
                    </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>
<p> </p>
</body>
</html>

treestyle.css:

.acidjs-css3-treeview,
.acidjs-css3-treeview *
{
    padding: 0;
    margin: 0;
    list-style: none;
}

.acidjs-css3-treeview label[for]::before,
.acidjs-css3-treeview label span::before
{
    content: "\25b6";
    display: inline-block;
    margin: 2px 0 0;
    width: 13px;
    height: 13px;
    vertical-align: top;
    text-align: center;
    color: #e74c3c;
    font-size: 8px;
    line-height: 13px;
}

.acidjs-css3-treeview li ul
{
    margin: 0 0 0 22px;
}

.acidjs-css3-treeview *
{
    vertical-align: middle;
}

.acidjs-css3-treeview
{
    font: normal 11px/16px "Segoe UI", Arial, Sans-serif;
}

.acidjs-css3-treeview li
{
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.acidjs-css3-treeview input[type="checkbox"]
{
    display: none;
}

.acidjs-css3-treeview label
{
    cursor: pointer;
}

.acidjs-css3-treeview label[for]::before
{
    -webkit-transform: translatex(-24px);
    -moz-transform: translatex(-24px);
    -ms-transform: translatex(-24px);
    -o-transform: translatex(-24px);
    transform: translatex(-24px);
}

.acidjs-css3-treeview label span::before
{
    -webkit-transform: translatex(16px);
    -moz-transform: translatex(16px);
    -ms-transform: translatex(16px);
    -o-transform: translatex(16px);
    transform: translatex(16px);
}

.acidjs-css3-treeview input[type="checkbox"][id]:checked ~ label[for]::before
{
    content: "\25bc";
}

.acidjs-css3-treeview input[type="checkbox"][id]:not(:checked) ~ ul
{
    display: none;
}

.acidjs-css3-treeview label:not([for])
{
    margin: 0 8px 0 0;
}

.acidjs-css3-treeview label span::before
{
    content: "";
    border: solid 1px #1375b3;
    color: #1375b3;
    opacity: .50;
}

.acidjs-css3-treeview label input:checked + span::before
{
    content: "\2714";
    box-shadow: 0 0 2px rgba(0, 0, 0, .25) inset;
    opacity: 1;
}

有没有人知道如何修复它,在IE中工作?

0 个答案:

没有答案