javascript - How to apply toggleClass to an element? Galleria -


i try build custom theme, based on "galleria theme classic", i'm straggling trigger class on button, think, miss something,

   this.addelement('play').appendchild('container','play');    var g = this;    this.$('play').text('play').bind('mouseup', function() {             g.playtoggle();             g.toggleclass("highlight"); // - line don't work }); 

i error @typeerror: g.toggleclass not function@

it looks you're calling toggleclass on wrong element, or element not jquery wrapped (not quite clear posted code). try this:

$(g).toggleclass('highlight'); 

or this:

g.$('play').toggleclass('highlight'); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -