Reputation:
I have some code like this:
$(document).on("taphold", ".card-cart", function(event) {
if ($(this).hasClass("delete-mode-on")) {
$(this).toggleClass("delete-mode-on");
$(this).find(".card-delete-area").addClass("hidden");
}
else {
$(this).siblings(".card-cart").removeClass("delete-mode-on").find(".card-delete-area").addClass("hidden");
$(this).toggleClass("delete-mode-on");
$(this).find(".card-delete-area").removeClass("hidden");
}
});
When I test the code in FF it's not adding the class, but it works find in Safari, IE 11 and Chrome.
Any ideas?
Upvotes: 0
Views: 102
Reputation:
After some additional debugging I determined that some corruptly parsed JSON was saved in my <div>
as HTML 5 data tags created by a for
loop. I removed the corrupted data and that resolved the issue.`
Upvotes: 1
Reputation: 336
why not use
$(selector).hide();
are you sure, that your selector is selecting the right node? maybe try your selector with
$(yourselector).css({border: '1px solid red'});
and see if it works
Upvotes: 0