From 5e35fbb85798fbaf21bfc634e4397483d1f57c77 Mon Sep 17 00:00:00 2001 From: liudan <18634735655@163.com> Date: Sat, 10 Dec 2022 16:57:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.leoTextAnimate.js | 209 ------------------------------------ 1 file changed, 209 deletions(-) delete mode 100644 js/jquery.leoTextAnimate.js diff --git a/js/jquery.leoTextAnimate.js b/js/jquery.leoTextAnimate.js deleted file mode 100644 index dc37ec4..0000000 --- a/js/jquery.leoTextAnimate.js +++ /dev/null @@ -1,209 +0,0 @@ -;(function($, window, document, undefined) { - var leoTextAnimate = function(eles, opts) { - this.element = $(eles); - this.string = $(eles).html(); - this.defaults = { - speed: 2500, - autorun: true, - delay: 0, - fixed: '', - start: '' - }; - this.options = $.extend({}, this.defaults, opts); - this.height = $(eles).height(); - } - leoTextAnimate.prototype = { - init: function() { - if (this.element.find('.TextAnimate').length <= 0) { - var html = method.getHtml(this.options, this.string); - - // console.log(html) - this.element.html(html); - } - this.reset(); - if (this.options.autorun) { - if (this.options.delay == 0) { - this.run(); - } else { - var $this = this; - setTimeout(function() { - $this.run(); - }, - this.options.delay); - } - } - }, - reload: function() { - if(this.options.text){ - this.string = this.options.text; - this.element.html(this.options.text); - } - this.init(); - }, - reset: function() { - var $this = this.element.find('.TextAnimate'); - $this.css({ - 'overflow': 'hidden', - 'display':'inline-block', - 'vertical-align':'top', - 'height': this.height - }).find("span").css({ - 'display': 'inline-block', - 'vertical-align': 'top', - 'position': 'relative', - 'top': '0px', - 'transform': 'translateY(0px)', - '-ms-transform': 'translateY(0px)', - '-moz-transform': 'translateY(0px)', - '-webkit-transform': 'translateY(0px)', - '-o-transform': 'translateY(0px)', - '-ms-transition': '0s', - '-moz-transition': '0s', - '-webkit-transition': '0s', - '-o-transition': '0s', - 'transition': '0s' - }).find("i").css({ - 'display': 'block', - 'font-style': 'normal', - 'height': this.height - }); - }, - run: function() { - var speed = this.options.speed; - var height = this.height; - this.reset(); - this.element.find("span").each(function() { - var $this = $(this); - var length = $this.find('i').index($this.find('.on')); - var to = -length * height + 'px'; - if (to != $this.css("top")) { - if (!window.applicationCache) { - $this.animate({ - top: to - }, - speed); - } else { - $this.css({ - 'transform': 'translateY(' + to + ')', - '-ms-transform': 'translateY(' + to + ')', - '-moz-transform': 'translateY(' + to + ')', - '-webkit-transform': 'translateY(' + to + ')', - '-o-transform': 'translateY(' + to + ')', - '-ms-transition': speed / 1000 + 's', - '-moz-transition': speed / 1000 + 's', - '-webkit-transition': speed / 1000 + 's', - '-o-transition': speed / 1000 + 's', - 'transition': speed / 1000 + 's' - }); - } - } - }); - } - } - var method = { - getNumber: function(options, string) { - if(!this.inArr(options.fixed, string)) { - var text = ''; - if (options.start !== '') { - text += '' + options.start + ''; - } - for (var i = 0; i < 10; i++) { - text += '' + i + ''; - } - return text + ''; - } else { - return '' + string + ''; - } - }, - getLowerCase: function(options, string, code) { - if (!this.inArr(options.fixed, string)) { - var text = ''; - if (options.start !== '') { - text += '' + options.start + ''; - } - for (var i = 0; i < 26; i++) { - text += '' + String.fromCharCode(97 + i) + ''; - } - return text + ''; - } else { - return '' + string + ''; - } - }, - getUpperCase: function(options, string, code) { - if (!this.inArr(options.fixed, string)) { - var text = ''; - if (options.start !== '') { - text += '' + options.start + ''; - } - for (var i = 0; i < 26; i++) { - text += '' + String.fromCharCode(65 + i) + ''; - } - return text + ''; - } else { - return '' + string + ''; - } - }, - getUnicode: function(options, string, code) { - if (!this.inArr(options.fixed, string)) { - var text = ''; - if (options.start !== '') { - text += '' + options.start + ''; - } - for (var i = (code - this.getRand(2, 7)); i < (code + this.getRand(3, 10)); i++) { - text += '' + String.fromCharCode(i) + ''; - } - return text + ''; - } else { - return '' + string + ''; - } - }, - getHtml: function(options, string) { - var html = '