Skip to main content

selector

selector : *

[static] When you pass a string to a SplitText (as the first parameter), it will feed that to its selector engine internally to find the element(s), and document.querySelectorAll() is used by default, or jQuery if it happens to be loaded.

Details

When you pass a string to a SplitText (as the first parameter), it will feed that to its selector engine internally to find the element(s), document.querySelectorAll() is used by default, or jQuery if it happens to be loaded. You can define a custom selector engine like Sizzle or Zepto or your own like this:

//use Zepto
SplitText.selector = Zepto;
//use Sizzle:
SplitText.selector = Sizzle;
//or use your own:
SplitText.selector = function(text) { return document.querySelectorAll(text);}

Contents