Trying to use a tag plugin https://timseverien.com/projects/taggd/, got the basic part ok. When I try to call a function, it says function not defined.
taggd.show()
Trying to use a tag plugin https://timseverien.com/projects/taggd/, got the basic part ok. When I try to call a function, it says function not defined.
taggd.show()
taggd var is undefined... either chain the .show() or assign a var.
Chain:
$('.item').taggd( options, data ).hide().show(1);
Assign a var: (as your original code, just assigned a var taggd)
var taggd = $('.item').taggd( options, data );
taggd.hide();
taggd.show(1);
taggd is a jQuery plugin, so it needs to be used with a jQuery selector, like this:
$('.taggd').taggd( options, data );
The examples given by the plugin website require that the variable taggd has already been assigned and can therefore be used like this:
var taggd = $('.taggd').taggd( options, data );
taggd.hide();
taggd.show();
(Admittedly, this is not particularly clear in their examples.)
Alternatively, you can simple chain commands like this:
$('.taggd').taggd( options, data ).hide().show();
taggd.show()- @RoryMcCrossan jsfiddle works for me