Home  >  Article  >  Web Front-end  >  基于jQuery的模仿新浪微博时间的组件_javascript技巧

基于jQuery的模仿新浪微博时间的组件_javascript技巧

WBOY
WBOYOriginal
2016-05-16 18:01:161105browse

首先,说下有些人说这是重复造轮子,但我觉得不是,做项目,总不能老是拿别人的东西来吧,拿来主义并不是神马好玩意,当然如果你想轻松,也没话说,至少说我自己做得,我改起来或者扩展比较方便
效果以及代码如下,,预览效果自己放在html里面把,搞在这个页面上麻烦得很

复制代码 代码如下:




Untitled Page











";
calendar.css({ left: of.left, top: of.top + 18 }).html(se).appendTo($("body"));
setDate(td.getFullYear(), td.getMonth());
$("#calendar .year").attr("value", td.getFullYear());
$("#calendar .month").attr("value", td.getMonth());
bindClick();
}
}
function bindClick() { //给下拉列表绑定时间
var a = $("#calendar .month"),
b = $("#calendar .year");
a.change(function () {
setDate(b.attr("value"), $(this).attr("value"));
});
b.change(function () {
setDate($(this).attr("value"), a.attr("value"));
});
}
return {
init: function (obj) { //返回调用的接口
OBJ = obj;
createTime();
}
}
})(jQuery);
//使用方法
$(".tiemin").focus(function(){
sookerTime.init($(this));
});



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn