Event toggle_sidebar

1

How do I know if toggle_sidebar is enabled or not?

I use this command to enable and disable:

uib_sb.toggle_sidebar($(".uib_w_43"));
    
asked by anonymous 14.12.2015 / 16:23

1 answer

2

Use hasClass() to know if the element has the class the class that makes it active, for example:

if($('.uib_w_43').hasClass('.uib_bar_visible')){
   // Está ativo...
}

Or you can do without jQuery, using classlist#contains() :

var foo = document.querySelector('.uib_w_43');
if(foo.classList.contains('uib_bar_visible'){
  // Está ativo...
}
    
14.12.2015 / 16:34