-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.js
76 lines (65 loc) · 2.6 KB
/
jquery.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
68
69
70
71
72
73
74
75
$(document).ready(function(e) {
var championName = '';
console.log("JQuery.js PING");
$("li a").each(function() {
championName = $(this).text();
personPhoto = "champions/" + championName + "_Square_0.png";
url = 'url(' + personPhoto + ')'
$(this).css('background-image', url);
$(this).css('background-position-y', '73px');
});
// A solução optima seria fazer toogle class, mas pelo
// facto de estar tudo com id's as classes passam a não funcionar
// por causa das hierarquias css
$("#jungleCircle").click(function(){
$("#jungleCircle").addClass("highlight");
$("#jungleCircle").removeClass("not-highlight");
$( "#jungleCircle" ).siblings().removeClass("highlight");
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
});
$("#midCircle").click(function(){
$("#midCircle").addClass("highlight");
$("#midCircle").removeClass("not-highlight");
$( "#midCircle" ).siblings().removeClass("highlight");
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
});
$("#topCircle").click(function(){
$("#topCircle").addClass("highlight");
$("#topCircle").removeClass("not-highlight");
$( "#topCircle" ).siblings().removeClass("highlight");
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
});
$("#adcCircle").click(function(){
$("#adcCircle").addClass("highlight");
$("#adcCircle").removeClass("not-highlight");
$( "#adcCircle" ).siblings().removeClass("highlight");
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
});
$("#supportCircle").click(function(){
$("#supportCircle").addClass("highlight");
$("#supportCircle").removeClass("not-highlight");
$( "#supportCircle" ).siblings().removeClass("highlight");
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
});
$("#championsCircle").click(function(){
$("#championsCircle").addClass("highlight");
$("#championsCircle").removeClass("not-highlight");
$( "#championsCircle" ).siblings().removeClass("highlight");
$( "#championsCircle" ).siblings().addClass("not-highlight");
$("#supportCircle").css("top","60px");
$("#supportCircle").css("left","75px");
$("#adcCircle").css("top","-223px");
$("#adcCircle").css("left","143px");
$("#topCircle").css("top","-368px");
$("#topCircle").css("left","32px");
$("#midCircle").css("top","-171px");
$("#midCircle").css("left","210px");
$("#jungleCircle").css("top","-218px");
$("#jungleCircle").css("left","253px");
});
});