function circles className var selector className if topPx selector cs

 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
function circles(className){
var selector = "." + className;
if (a == 1) {
topPx = $(selector).css('top');
leftPx = $(selector).css('left');
var newTopPx = parseInt(topPx.substring(0, topPx.length - 2)) - 25;
var newLeftPx = parseInt(leftPx.substring(0, leftPx.length - 2)) - 25;
background = $(selector).css('background-image');
$(selector).css('background', '#2358A3');
$(selector).animate({
width:"250px",
height:"250px",
borderRadius:"150px",
top:newTopPx + "px",
left:newLeftPx + "px"
}, 50);
a = a * -1;
}
else{
$(selector).css('background-image', background);
$(selector).css('background-size', 'contain');
$(selector).animate({
width:"200px",
height:"200px",
borderRadius:"110px",
top:topPx,
left:leftPx
}, 50);
a = a * -1;
}
}