-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.js
41 lines (35 loc) · 1.17 KB
/
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
39
40
41
function hesaplama(){
var s1=Number(document.getElementById("fuel").value);
var s2=Number(document.getElementById("emusyon").value);
var sonuc = s1 * s2;
document.getElementById("Sonuc").innerHTML="Sonuç : "+sonuc+' (kg.CO2)';
}
function myFunction() {
var txt;
if (confirm("You will be redirected to another site !")) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
document.getElementById("demo").innerHTML = txt;
}
$(document).ready(function() {
var front = document.getElementsByClassName("front");
var back = document.getElementsByClassName("back");
var highest = 0;
var absoluteSide = "";
for (var i = 0; i < front.length; i++) {
if (front[i].offsetHeight > back[i].offsetHeight) {
if (front[i].offsetHeight > highest) {
highest = front[i].offsetHeight;
absoluteSide = ".front";
}
} else if (back[i].offsetHeight > highest) {
highest = back[i].offsetHeight;
absoluteSide = ".back";
}
}
$(".front").css("height", highest);
$(".back").css("height", highest);
$(absoluteSide).css("position", "absolute");
});