jQuery的滑块按钮显示了通过数据采集器 [英] jQuery slider button shows through data picker

查看:172
本文介绍了jQuery的滑块按钮显示了通过数据采集器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格和一个jQuery滑块略低于它放在一个jQuery日期选择器。当我选择的日期选择器日历弹出,但是从滑块按钮在日历的顶部可见。

I have a jQuery datepicker on a form and a jQuery slider just below it. When I select the datepicker the calendar pops up, but the button from the slider is visible on top of the calendar.

有没有一种方法,以确保日历是如何形成的?

Is there a way to make sure that the calendar is on top of all other elements on the form?

下面是页面的源代码code:

Here's the page source code:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>My ASP.NET Web Page</title>
        <link href="../Styles/Site.css" rel="stylesheet" />
        <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />

        <link type="text/css" href="../css/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
        <script type="text/javascript" src="../js/jquery-ui-1.8.16.custom.min.js"></script>

        <script type="text/javascript">
            //date picker
            $(function () {
                $("#classDate").datepicker({ minDate: 0 });
            });

            //Slider1
            $(function() {
                $("#slider1").slider({
                     value:60,
                     min: 0,
                     max: 120,
                     step: 5,
                     slide: function( event, ui ) {
                         $("#class1").val(ui.value);
                     }
                 });
                 $("#class1").val($("#slider1").slider("value"));
            });

            //Slider2
            $(function () {
                $("#slider2").slider({
                    value: 6,
                    min: 1,
                    max: 12,
                    step: 1,
                    slide: function (event, ui) {
                        $("#class2").val(ui.value);
                    }
                });
                $("#class2").val($("#slider2").slider("value"));
            });
        </script>
    </head>

    <body>
        <div id="page">
            <div id="main">
                <div id="content">
                    <form method="post" action="">
                        <fieldset>
                            <legend>Sign-up Form</legend>
                            <ol>
                                <li class="classDate">
                                    <label for="classDate">Date:</label>
                                    <input type="text" id="classDate" name="classDate" title="Start Date"  />
                                </li>
                                <li class="class1">
                                    <label for="class1">Slider1:</label>
                                    <input type="text" id="class1" name="class1" title="slider1" style="border:0; color:#f6931f; font-weight:bold;"  />
                                    <br/>
                                    <div id="slider1" class="slider" ></div>
                                </li>
                                <li class="class2">
                                    <label for="class2">Slider2:</label>
                                    <input type="text" id="class2" name="class2" title="slider2" style="border:0; color:#f6931f; font-weight:bold;"  />
                                    <br /><div id="slider2" class="slider" ></div>

                                </li>
                            </ol>
                            <p class="form-actions">
                                <input type="submit" value="createClass" title="createClass" />
                            </p>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>

编辑:

不过在这无人问津,所以这里的一个图像,使其清楚。左侧显示的正常形态;几箱和滑块。右侧显示当用户尝试选择日期时会发生什么。你可以看到,滑块的按钮出现在弹出的日历上。

Still no takers on this, so here's a image to make it clear. The left side shows the normal form; a few boxes and sliders. The right side shows what happens when a user tries to select a date. You can see that the button for the slider is appearing on top of the calendar that pops up.

推荐答案

添加到您的CSS:

.ui-datepicker {z-index:3!important;}

这篇关于jQuery的滑块按钮显示了通过数据采集器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆