Skip to content

Enable/disable all instances programmatically to allow user preferences? #1138

Closed Answered by kslstn
kslstn asked this question in Q&A
Discussion options

You must be logged in to vote

This seems to work:

tippy.setDefaultProps({
  delay: [1000, 250],
  arrow: true,
  animation: 'shift-away',
  duration: 50,
  plugins: [followCursor],
  maxWidth: 800,
});

const tippyDelegation = delegate('#aftel', {
  target: '[data-tippy-content]',
  theme: 'aftel',
});

const disableAll = function(){
  hideAll()
  for (let instance of tippyDelegation) instance.disable();
}
const enableAll = function(){
  for (let instance of tippyDelegation) instance.enable();
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kslstn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant