I'm trying to make a transition with jQuery
using the fadeOut
and fadeIn
but not when I'm wrong because I'm new at this and would like a little help!
我正在尝试使用fadeOut和fadeIn进行jQuery转换,但不是因为我错了,因为我是新手,想要一点帮助!
by clicking on the "btn-login"
to hide the main div
but action must continue to show the other div
is actually not passing because only makes effect fadeout
but does not remove the class "hidden"
to him add and no does fadeIn
通过单击“btn-login”来隐藏主div但是动作必须继续显示其他div实际上没有通过因为只有效果淡出但是没有删除类“隐藏”给他添加而没有fadeIn
here the example:
这里的例子:
here my script:
在这里我的脚本:
$( document ).ready(function() {
$(".btn-login").click(function() {
$("#inicio_sesion").fadeOut(1000, function(){
$("recuperar_clave").removeClass("hidden").fadeIn(3000);
});
});
});
1 个解决方案
#1
Solved:
thanks to john-s
感谢john-s
<script>
$( document ).ready(function() {
$(".btn-recuperar").click(function() {
$("#inicio_sesion").fadeOut(500, function(){
$("#recuperar_clave").fadeIn(500).removeClass("hidden");
});
});
$(".btn-login-back").click(function() {
$("#recuperar_clave").fadeOut(500, function(){
$("#inicio_sesion").fadeIn(500);
});
});
});
</script>
#1
Solved:
thanks to john-s
感谢john-s
<script>
$( document ).ready(function() {
$(".btn-recuperar").click(function() {
$("#inicio_sesion").fadeOut(500, function(){
$("#recuperar_clave").fadeIn(500).removeClass("hidden");
});
});
$(".btn-login-back").click(function() {
$("#recuperar_clave").fadeOut(500, function(){
$("#inicio_sesion").fadeIn(500);
});
});
});
</script>