-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcat_vote.js
More file actions
23 lines (23 loc) · 763 Bytes
/
cat_vote.js
File metadata and controls
23 lines (23 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$(document).ready(function() {
var sound_cat = $("#vote_cat_sound").get(0),
is_audio_load = false;
if (!isNaN(sound_cat.duration)) {
is_audio_load = true;
sound_cat.volume = 1.0;
}
$('.vote_cat > a').hover(function() {
if (is_audio_load) {
sound_cat.currentTime = 0;
sound_cat.play();
}
$(this).find(".layer1").stop(true, true).fadeOut(300);
$(this).find(".layer2").stop(true, true).fadeIn(100);
$(this).find(".message").stop(true, true).fadeIn(100);
}, function() {
$(this).find(".layer2").stop(true, true).fadeOut(300);
$(this).find(".message").stop(true, true).fadeOut(300);
$(this).find(".layer1").stop(true, true).fadeIn(100);
}).find(".layer2").css({
'display': 'block'
}).hide()
});