0
我自己製作了一個小時間選擇器,叫它xxxtimepicker。我在下面粘貼一些代碼,但問題是沒有任何反應。任何提示/技巧和幫助時,使一個像日期選擇器一樣的插件?幫我開始使用我自己的jquery插件
(function($){
var popupname = "timepickerpopup";
function OpenWindow(parentObj) {
var popup = $('<div id="'+popupname+'" style="">POPUP</div>');
var offset = $(parentObj).offset();
offset.top += 20;
$(popup).offset(offset);
$("body").append(popup);
$("body").append('<script>$("#timepickerpopup").dialog({autoOpen: false});</script>');
}
function CloseWindow() {
$("#"+popupname).remove();
}
$.fn.extend({
xxxtimepicker: function() {
var defaults = {
varname: "val",
var2name: "val"
};
var options = $.extend(defaults, options);
return this.each(function() {
var o = options;
var obj = $(this);
obj.bind("focus", OpenWindow(this));
obj.bind("blur", CloseWindow);
});
}
});
})(jQuery);