Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to swap between two different words(one word in English and other word in telugu),once a second?
my code is like:
JavaScript
$(document).ready(function($) {
  var telugu= "ఆ౦ధ",
  var target = $("#target"),
      word = target.text();
  setInterval(function() {
      word = word === "Andhra" ? $(telugu) : "Andhra";
     target.fadeOut('fast', function() {
          target.text(word).fadeIn('fast');
      });
  }, 1000);
  
})(jQuery);

and
JavaScript
$(document).ready(function($) {
  var target = $("#target"),
      word = target.text();
  setInterval(function() {
      word = word === "Andhra" ? "ఆ౦ధ" : "Andhra";
     target.fadeOut('fast', function() {
          target.text(word).fadeIn('fast');
      });
  }, 1000);
  
})(jQuery);

But this is not working in either way.please help me out.
Thanks in advance.
Posted
Updated 4-Jan-13 22:26pm
v2

1 solution

Try this -
XML
$(document).ready(function ($) {
    var telugu = "ఆ౦ధ";
    var english = "Andhra";
    var target = $("#target");
    word = english;
    setInterval(function () {
        target.fadeOut('fast', function () {
            target.text(word).fadeIn('fast');
        });
        word = (word === english ? telugu : english);

    }, 1000);

});
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900