tab.js
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$(document).ready(function(){
$("div.yearoption").bind("mouseover",function(){
$(this).addClass("yearoption_hover");
}).bind("mouseout",function(){
$(this).removeClass("yearoption_hover");
}).bind("click",function(){
var _val = $(this).attr("_val");
changeYear(_val);
});
$("#yearpanel").bind("click",function(){
var _t = $(this).offset().top+$("#yearpanel").height();
var _l = $(this).offset().left;
$("#yearselect").css({"top":_t,"left":_l}).show();
});
$("div.weekoption").bind("mouseover",function(){
$(this).addClass("weekoption_hover");
}).bind("mouseout",function(){
$(this).removeClass("weekoption_hover");
});
$("div.week_prev").bind("mouseover",function(){
$(this).addClass("week_prev_hover");
}).bind("mouseout",function(){
$(this).removeClass("week_prev_hover");
});
$("div.week_next").bind("mouseover",function(){
$(this).addClass("week_next_hover");
}).bind("mouseout",function(){
$(this).removeClass("week_next_hover");
});
$("#monthpanel").bind("click",function(){
var _t = $(this).offset().top+$(this).height();
var _l = $(this).offset().left-17;
$("#monthselect").css({"top":_t,"left":_l}).show();
});
$("#weekpanel").bind("click",function(){
var _t = $(this).offset().top+$(this).height();
var _l = $(this).offset().left-17;
$("#weekselect").css({"top":_t,"left":_l}).show();
});
});
$(document).bind("click",function(e){
var target=$.event.fix(e).target;
if($(target).attr("id")!="yearpanel"){
$("#yearselect").hide();
}
if($(target).attr("id")!="monthpanel"){
$("#monthselect").hide();
}
if($(target).attr("id")!="weekpanel"){
$("#weekselect").hide();
}
});