forked from albancrommer/lqdn_campagne2012
-
Notifications
You must be signed in to change notification settings - Fork 3
/
campaign.js
68 lines (54 loc) · 1.47 KB
/
campaign.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function showMore(more_div) {
more_div.animate();
}
var anime_timer = 0;
var auto_anime = 0;
// switches text and figure
function switchAnime( id ){
$(".animed").hide();
$("#d"+id).show();
$(".anime_point").removeClass("active");
$("#"+id).addClass("active");
}
manualAnime=function(){
idname=$(this).attr("id");
switchAnime( idname );
}
$(document).ready(function() {
// mouseOver
$("a.anime_point").mouseover(manualAnime);
$("a.anime_point").click(manualAnime);
$("#header").mouseover(function() {
switchAnime("ap99");
});
$("#progress").mouseover(function() {
switchAnime("ap99");
});
$("#donations").mouseover(function() {
switchAnime("ap99");
});
// gifts
$(".amounts_holder input").click(function(e){
var src = $(this).parent("div").find(".alert")
var tgt = $(".giftContainer")
tgt.show().html(src.html())
});
// Activated the default donation radio button
$('.donations input[checked=checked]').click();
// auto select "other" radio button on text input focus
$(".othersum input[type=text]").on("focus",function(){
$("#sum1").attr("checked","checked")
})
// nocado = swap the other fields...
if ($("#nocado")) {
$("#nocado").click(function() {
if ($(this).attr("checked")) {
$("#needcado").hide();
} else {
$("#needcado").show();
}
});
}
// Default = show the demonstration
switchAnime("ap99");
})