var sel = document.getElementById("selectnat");
var start = 0, number = 10, more;
function darsteller_holen() {
var nat = sel.options[sel.selectedIndex].value;
if (nat == "alle") {
$("#figures-alfa").css("display", "block");
$("#figures-nat").css("display", "none");
} else {
$.ajax("darsteller-finden-3.php", {
data: { nat: nat, start: start, number: number },
method: "get",
success: function (data) {
$("#figures-nat").html($("#figures-nat").html() + data);
if ($("#figures-nat span#complete").length > 0)
$("#figures-nat #more").remove();
else
$("#figures-nat").append($("#figures-nat span#more").on("click", darsteller_holen));
}
});
}
start += number;
}
sel.addEventListener("change", function () {
start = 0;
$("#figures-nat").html("");
more = $('<span id="more">Mehr ... </span>');
$("#figures-nat").append(more);
$("#figures-alfa").css("display", "none");
$("#figures-nat").css("display", "block");
darsteller_holen();
});