-
Notifications
You must be signed in to change notification settings - Fork 1
/
js.js
43 lines (37 loc) · 1.36 KB
/
js.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
$(document).ready(function(){
var sehirid = 0;
$("#ekle-btn").click(function(){
sehirid++;
$(".sehirler").append('<input type="text" id="sehir'+sehirid+'">');
});
var sehirler = [];
var sondurum = 0;
$("#gonder-btn").click(function(){
var secim;
var sehirSayisi = $(".sehirler").children().length-1;
for(var i = 0; i < sehirSayisi; i++){
secim = "#sehir"+i;
sehirler.push($(secim).val());
}
$(".icerik").children().remove();
$(".icerik").append('<div id="demo" class="carousel slide" data-ride="carousel"><!-- The slideshow --><div class="carousel-inner"></div><!-- Left and right controls --><a class="carousel-control-prev" href="#demo" data-slide="prev"><span class="carousel-control-prev-icon"></span></a><a class="carousel-control-next" href="#demo" data-slide="next"><span class="carousel-control-next-icon"></span></a></div>');
$.post("getveri.php",{veri: sehirler}, function(ver){
sehirler = ver.split("*");
havadurumugetir();
});
});
function havadurumugetir(){
for(var i = 0; i <= sondurum+5 && i < sehirler.length; i++){
if(i%5 === 0){
if(sondurum == 0){
$(".carousel-inner").append('<div class="carousel-item active"></div>');
}
else{
$(".carousel-inner").append('<div class="carousel-item"></div>');
}
sondurum += 5;
}
$(".carousel-inner").children().last().append(sehirler[i]);
}
}
});