0

请查看下面的 HTML,其中我采用了 jQuery UI 日期选择器并尝试使用CSS3 PIE在 Internet Explorer <= 8 中为其设置圆角。该框显示圆角,但不显示日期选择器。我也position: relative; z-index: 0按照文档中的建议进行了申请。

<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
    <title>jQuery UI Example Page</title>  
    <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css" rel="stylesheet" />  
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>  
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>  
    <script type="text/javascript">  
        $(function () {  
            $('#datepicker').datepicker({  
                inline: true  
            });  
        });  
    </script>  
    <style type="text/css">  
        .roundedCorners {  
            -webkit-border-radius: 10px;  
            -moz-border-radius: 10px;  
            border-radius: 10px;  
            behavior: url(PIE.htc);  
            position: relative;  
            z-index: 0;  
        }  
    </style>  
</head>  
<body>  
    <div class="roundedCorners" style="width: 100px; height: 100px; background-color: Blue">  </div>  
    <br />  
    <div id="datepicker" class="roundedCorners"></div>  
</body>  
</html>  
4

1 回答 1

0
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>jQuery UI Example Page</title>
        <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css" rel="stylesheet" />
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $('#datepicker').datepicker({
                    inline: true
                });
            });
        </script>
        <style type="text/css">
            .roundedCorners {
                -webkit-border-radius: 10px;
                -moz-border-radius: 10px;
                border-radius: 10px;
                behavior: url(PIE.htc);
                position: relative;
                z-index: 0;
            }
            .ui-datepicker{
                -webkit-border-radius: 10px;
                -moz-border-radius: 10px;
                border-radius: 10px;
                behavior: url(PIE.htc);
                position: relative;
                z-index: 0;}
        </style>
    </head>
    <body>
        <div class="roundedCorners" style="width: 100px; height: 100px; background-color: Blue"> </div>
        <br />
        <div id="datepicker" class="roundedCorners"></div>
    </body>
</html>

您必须为特定的 UI 类添加圆角!

我对您的示例所做的修改适用于 FFX、Opera、IE8 和 IE8 兼容性视图。它只会显示带有圆角的外框。

这是一个修改,使 datepicer 在 IE8、FFX 3.1.5 和 Opera 10 中看起来相同

        .ui-datepicker-inline div{
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            behavior: url(PIE.htc);
            position: relative;
            z-index: 0;}
        .ui-datepicker-inline{
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            behavior: url(PIE.htc);
            position: relative;
            z-index: 0;}
于 2011-04-09T11:52:50.083 回答