SplitText.selector

SplitText.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 jQuery is used by default 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), and jQuery is used by default if it happens to be loaded. If jQuery isn't loaded, SplitText falls back to simply using document.getElementById() and strips out any leading "#", so IDs are always safe to use. 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) {
var list = document.querySelector(text),
a = [];
if (list) {
for (var i = 0; i < list.length; i++) {
a.push(list[i]);
}
}
return a;
}
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.

Get GSAP

Version: 1.20.3 updated 2017-10-02

Core

    Extras

      Plugins

        By using GreenSock code, you agree to the terms of use.

        Help support GreenSock by becoming a member

        Join Club GreenSock