(function($){
$.fn.extend({
setTime: function(){
var $this = $(this);
$(this).click(function(){
$("div").detach("#settime");
$("body").append(createDiv());
$("#settime").css({
padding:"3px",
position :"absolute",
"background-color":"#E3E3E3",
"font-size": "12px",
border: "1px solid #777777",
width:"170px",
top: $this.offset().top + 22,
left: $this.offset().left
})
$("input#time_submit").click(function(){
$this.val($("select[name='hour']").val() + ":" + $("select[name='minute']").val());
$("div").detach("#settime");
})
})
function createDiv(){
var str="
for (h = 0; h <= 9; h++) {
str += "0" + h + "";
}
for (h = 10; h <= 23; h++) {
str += "" + h + "";
}
str += "
分";for (h = 0; h <= 9; h++) {
str += "0" + h + "";
}
for (h = 10; h <= 59; h++) {
str += "" + h + "";
}
str += "
return str;
}
}
})
})(jQuery);