有没有大佬帮我我解答一下,我想实现点击注册按钮,然后滑动到右边👉 现在就js过不了
你 container 元素没有获取成功, container 的值是null
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!
首先你的代码查找id前端多个 .
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$(this).addClass("on");
});
});
</script>
<style type="text/css">
.intro.on{
position:relative;
animation:myfirst 5s;
-webkit-animation:myfirst 2s; /* Safari and Chrome */
animation-fill-mode:forwards
}
@keyframes myfirst
{
0% {left:0;}
100% {left:200px;}
}
</style>
</head>
<body>
<button class="intro">注册</button>
</body>
</html>