samedi 15 juin 2019

jQuery if statment on click event not working in Chrome but work in firefox

i use this code for hide and show element , but my JQuery code not working in chrome in else statement but work correctly in Firefox

Code

$(document).ready(function(){
  $(".item-title").on("click",function () {
      $(this).next('div').children().toggle();
      $(this).children().children('.fa-plus-square').hide()
      $(this).children().children('.fa-minus-square').show()
      if ($(this).next('div').children().is(':hidden')){
          $(this).addClass('bb')
      }
      else {
          $(this).removeClass('bb')
      }
  })

dont Remove class in if statment

Aucun commentaire:

Enregistrer un commentaire