tooltip - Foundation 6, plugin destroy -
i'm using tooltips display form errors. i'm trying display tooltips on inputs, validated ajax call.
on each submission want remove these tooltips, check validations, , display new set of tooltips if needed. i'm using foundation('destroy') method on each inputs have .has-tip class.
function displaytip(elt, msg){ var options = { tiptext: msg, templateclasses: 'tooltip--error', } elt.addclass('has-tip'); // <= using jquery 'cause triggerclass option seems not working... var tip = new foundation.tooltip(elt, options); } function hidetips(){ $('.has-tip').each(function(index){ $(this).removeclass('has-tip'); try { $(this).foundation('destroy'); } catch(e) { //console.info(); } }); }
unfortunately doesn't work , have these console errors:
foundation.js:8598 uncaught typeerror: cannot read property 'hoverdelay' of null foundation.js:8558 uncaught typeerror: cannot read property 'stop' of null
please ! :-)
Comments
Post a Comment