Answer the question
In order to leave comments, you need to log in
How to properly loop a function?
jQuery(function($){
$.get("{THEME}/images/sprite.svg", function(data) {
var div = document.createElement("div");
div.innerHTML = new XMLSerializer().serializeToString (data.documentElement);
document.body.insertBefore(div, document.body.childNodes[0]);
});
});
$(document).ready(function(){
$.fn.animate_Text = function() {
var string = this.text();
return this.each(function(){
var $this = $(this);
$this .html(string.replace(/./g, '$&'));
$this.find('span.new').each(function(i, el){
setTimeout(function(){ $(el) .addClass('div_opacity'); }, 60 * i);
});
});
};
$('#example').show();
$('#example').animate_Text();
$('#example').fadeOut(60000);
});
Answer the question
In order to leave comments, you need to log in
I'll delete the author's code, as I fix it myself:
jQuery(function($){
$.get("{THEME}/images/sprite.svg", function(data) {
var div = document.createElement("div");
div.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
document.body.insertBefore(div, document.body.childNodes[0]);
});
});
$(document).ready(function(){
$.fn.animate_Text = function() {
var string = this.text();
return this.each(function(){
var $this = $(this);
$this.html(string.replace(/./g, '$&'));
$this.find('span.new').each(function(i, el){
setTimeout(function(){ $(el).addClass('div_opacity'); }, 60 * i);
});
});
};
$('#example').show();
$('#example').animate_Text();
$('#example').fadeOut(60000);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question