Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function panime (i = 0){
- $(ps[i]).text(function(){
- if(val != ''){
- a_str = $(this).text().trim().split(" ");
- len = a_str.length;
- var v = '';
- if(len > 5){
- v = len / 5;
- v = Math.round(v);
- }else{
- v = 1
- }
- search = '';
- ini = 0
- //Conformamos la cadena a trabajar.
- for(c = 0; c < v; c++){
- a_seg = '';
- a_seg = a_str.splice(ini,5);
- if(a_seg != ''){
- hidden_text(a_seg,ps[i]);
- search = '';
- ini = ini + 5;
- }
- }
- panime(i + 1);
- }
- });
- }
- function hidden_text(a_seg,tp,callback) {
- search = a_seg.toString().replace(/,/gi," ");
- search = search.replace(/ /g,"");
- var regex = new RegExp(search,'gi');
- $(tp).html($(this).text().replace(regex,'<span style="color: #ff0000; font-size: 18px;">'+search+'</span>'));
- if (callback && typeof(callback) === "function") {
- callback();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement