Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. function panime (i = 0){
  2.  
  3. $(ps[i]).text(function(){
  4. if(val != ''){
  5. a_str = $(this).text().trim().split(" ");
  6. len = a_str.length;
  7. var v = '';
  8. if(len > 5){
  9. v = len / 5;
  10. v = Math.round(v);
  11. }else{
  12. v = 1
  13. }
  14. search = '';
  15. ini = 0
  16. //Conformamos la cadena a trabajar.
  17. for(c = 0; c < v; c++){
  18. a_seg = '';
  19. a_seg = a_str.splice(ini,5);
  20. if(a_seg != ''){
  21.  
  22. hidden_text(a_seg,ps[i]);
  23. search = '';
  24. ini = ini + 5;
  25. }
  26. }
  27. panime(i + 1);
  28. }
  29. });
  30.  
  31. }
  32.  
  33. function hidden_text(a_seg,tp,callback) {
  34.  
  35. search = a_seg.toString().replace(/,/gi," ");
  36. search = search.replace(/&nbsp;/g,"");
  37. var regex = new RegExp(search,'gi');
  38. $(tp).html($(this).text().replace(regex,'<span style="color: #ff0000; font-size: 18px;">'+search+'</span>'));
  39.  
  40. if (callback && typeof(callback) === "function") {
  41. callback();
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement