jquery中的关键帧动画不工作

jquery中的关键帧动画不工作,jquery,Jquery,有谁能告诉我为什么关键帧动画在jquery中不起作用。我搜索了很多示例,但没有找到错误的地方。在一些代码中,我看到了引号中的关键帧(例如0%、50%等),而在其他一些代码中则不起作用。哪一个是正确的,因为两者都不起作用。我已经对关键帧动画部分进行了注释 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>

有谁能告诉我为什么关键帧动画在jquery中不起作用。我搜索了很多示例,但没有找到错误的地方。在一些代码中,我看到了引号中的关键帧(例如0%、50%等),而在其他一些代码中则不起作用。哪一个是正确的,因为两者都不起作用。我已经对关键帧动画部分进行了注释

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script>

        $(document).ready(function(){                                               


            $.keyframe.define([{
                name: 'myfirst',
                '0%':   {'top':'-20px'},
                '50%':   {'top':'20px'},
                //'50%': {'top':$("img[name=registrationimg]").innerHeight() + "20px"},
                '100%': {'top':$("img[name=registrationimg]").innerHeight() }
            }]);

            $("img[name=registrationimg]").playKeyframe({
                name: 'myfirst',
                duration: 2000
            });


        });

    </script>

$(文档).ready(函数(){
$.keyframe.define([{
名称:“myfirst”,
'0%':{'top':'-20px'},
'50%':{'top':'20px'},
//'50%':{'top':$(“img[name=registrationimg]”)。innerHeight()+“20px”},
'100%':{'top':$('img[name=registrationimg]')。innerHeight()}
}]);
$(“img[name=registrationimg]”)。播放关键帧({
名称:“myfirst”,
持续时间:2000年
});
});
HTML:

<div id="header">           
        <h1>USER REGISTRATION</h1>
    </div>
    <div id="imagediv">
        <img name="registrationimg" src="registration.jpg"/>
    </div>
    <div id="registrationdiv"><center>      
    <form name="registrationform"  onsubmit="submitform()">
        <table id="registrationtable" cellspacing="10">
            <tr><td>Email <font color="red">*</font> : </td><td><input type="email" name="email" placeholder="vallabh@harbingergroup.com"></td></tr>
            <tr><td>Password <font color="red">*</font> : </td><td><input type="password"></td></tr>
            <tr><td>Confirm Password <font color="red">*</font> : </td><td><input type="password" name="repassword"></td></tr>
            <tr><td>First Name <font color="red">*</font> : </td><td><input type="text" placeholder="Vallabh" name="firstname"></td></tr>
            <tr><td>Last Name : </td><td><input type="text"></td></tr>
            <tr><td>Address : </td><td><input type="text"></td></tr>
            <tr><td>City : </td><td><input type="text" ></td></tr>
            <tr><td>State : </td><td><input type="text" ></td></tr>
            <tr><td>Country : <font color="red">*</font></td><td><input type="text" placeholder="India" name="country"></td></tr>
            <tr><td>Phone : </td><td><input type="tel" ></td></tr>
            <tr><td>Zipcode : </td><td><input type="number" ></td></tr>
            <tr><td>Date of Birth <font color="red">*</font> : </td><td><input type="date" name="dob"></td></tr>
            <tr><td colspan="2">By submitting, I agree that all information entered was done accurately & truthfully.</td></tr>
            <tr><td>I accept <input type="checkbox" name="accept" id="iaccept"></td></tr>
            <tr><td><input type="submit" name="Submit"></td><td><input type="reset" name="Reset"></td></tr>
        </table>
    </form></center>
    </div>

用户注册
电邮*:
密码*:
确认密码*:
姓名*:
姓氏:
地址:
城市:
声明:
国家:*
电话:
Zipcode:
出生日期*:
通过提交,我同意所有输入的信息都是准确和真实的。
我接受

它应该做什么和没有做什么?在这把小提琴中,它似乎起作用了:我已经注释掉了不起作用的代码。现在就试试看好的,只是为了让我明白,你想实现反弹效果吗?