Animate an input value doesn't work

Discussion in 'jQuery' started by sykes3d, Jul 3, 2013.

  1. #1
    I was trying to animate an input value, but doesn't work whatever I do.

    
    <body>
    <form>
     
    <input type="text" name="name" />
    <input type="submit" id="submit" name="submit" value=">" />
     
    </form>
     
    <script>
     
    function inputValueAnimation()
    {
        $("#submit").val().animate(
            {
                opacity: 0
            }, "fast", "swing").animate(
            {
                opacity: 1
            }, "fast", "swing");
    }
     
    $(document).ready(function()
    {
        setInterval ( "inputValueAnimation()", 600 );
    });
     
    </script>
    </body>
    Code (markup):
     
    sykes3d, Jul 3, 2013 IP
  2. ekim941

    ekim941 Member

    Messages:
    74
    Likes Received:
    7
    Best Answers:
    7
    Trophy Points:
    33
    #2
    In your call to setInterval, your function should not be in quotes:
    setInterval(inputValueAnimation(), 600);
     
    ekim941, Jul 3, 2013 IP