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
Post a Comment