Answer the question
In order to leave comments, you need to log in
How to implement removing a block after adding it via prepend?
Hello.
There is a filter that adds div blocks with the .disabled class in place, but for some reason I can’t remove it after changing the filters
// скрипт фильтра
$(function() {
var newSelection = "";
$(".nav-menu").click(function(){
$(".nav-menu").removeClass("selected");
$(this).addClass("selected");
newSelection = $(this).attr("rel");
$(".country-block").not("."+newSelection).fadeTo(800, 0.33).prepend('<div class="disabled"></div>');
$("."+newSelection).fadeTo(800, 1).remove('.disabled');
$(".all-flavors").fadeTo(600, 1);
});
});
.disabled {
background: rgba(20,26,31,0.9);
cursor: default;
width: 100%;
height: 100%;
z-index: 99999;
position: absolute;
}
Answer the question
In order to leave comments, you need to log in
$("."+newSelection).fadeTo(800, 1).remove('.disabled');
$("."+newSelection).fadeTo(800, 1);
$('.disabled').remove();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question