Ich versuche, ein angeklicktes Element in einer geordneten Liste auszublenden. on() scheint das Element zurückzugeben, das ich dann manipulieren kann, aber wie erzeuge ich den Selektor, um die sichtbare Li, die ich im HTML angeklickt habe, auszublenden? Danke!JQuery FadeOut Listenelement beim Klick
Hier ist mein Code, Linie in Frage ist nach unten hin:
$("#steplist").on("click", ".step", function() {
var stepIndex = 0;
var li = this; // is the returned line
//gets index of clicked line in array by looping through elements
while (li.previousElementSibling) {
stepIndex++; //increments index counter
li = li.previousElementSibling; //sets li to be next li
}
//sets vars to values in temp, time fields
var temp = $("#temp").val();
var time = $("#time").val();
if (temp == 0 || time == 0) {
//alert("removing step" + stepIndex);
steps.splice(stepIndex, 1);
} else if (temp != 0 && time != 0) {
//needSelectorHere.fadeOut(3000, function(){
}); steps.splice(stepIndex, 1, [temp, time]);
}
updateMash();
});
u kann eine Geige teilen? –