-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy pathjq_javascript.js
38 lines (36 loc) · 1.42 KB
/
jq_javascript.js
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
/*
* Smart event highlighting
* Handles when events span rows, or don't have a background color
*/
jQuery(document).ready(function($) {
var highlight_color = "#6ABEFF";
var bg_color = null;
// highlight events that have a background color
$(".ec-event-bg").live("mouseover", function() {
event_id = $(this).attr("data-event-id");
event_class_name = $(this).attr("data-event-class");
bg_color = $(".ec-"+event_class_name+"-"+event_id).css("background-color");
$(".ec-"+event_class_name+"-"+event_id).css("background-color", highlight_color);
});
$(".ec-event-bg").live("mouseout", function() {
event_id = $(this).attr("data-event-id");
event_class_name = $(this).attr("data-event-class");
$(".ec-"+event_class_name+"-"+event_id).css("background-color", bg_color);
});
// highlight events that don't have a background color
$(".ec-event-no-bg").live("mouseover", function() {
ele = $(this);
ele.css("color", "white");
ele.find("a").css("color", "white");
ele.find(".ec-bullet").css("background-color", "white");
ele.css("background-color", highlight_color);
});
$(".ec-event-no-bg").live("mouseout", function() {
ele = $(this);
event_color = $(this).attr("data-color");
ele.css("color", event_color);
ele.find("a").css("color", event_color);
ele.find(".ec-bullet").css("background-color", event_color);
ele.css("background-color", "transparent");
});
});