English 中文(简体)
想要打开日期选择器日历作为对话框
原标题:Want to open datepicker calendar as a dialog

我想打开日期选择器日历作为对话框, 这样当日历被打开时, 所有其他的窗体元素都得不到焦点 。 是否有日期选择器的默认设置, 可以作为对话框打开?

最佳回答

你能试试这个吗?

$(function() {
    $("#datepicker").datepicker({
        beforeShow: function(input, inst) {
            $( <div class="ui-widget-overlay" style="width: 2000px; height: 2000px; z-index: 1002; left:0; top:0; position :fixed"></div> ).insertBefore( #ui-datepicker-div );
            setTimeout(function(){$( #ui-datepicker-div ).css( z-index , 199999);},2);

        },
        onClose: function(dateText, inst) {

            $( .ui-widget-overlay ).remove();
        }

    });
});

这是一个小小的黑客, 这个想法基本上是在日期选择器下加盖( 在 jquery 对话框模式中的一种使用) 。

问题回答

您可以使用一个花式框, 它反过来可以包含文本输入和日历控制。 在花式框关闭时, 您可以将日期值传送到父页上的任何文本输入或标签 。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签