【发布时间】:2018-03-02 22:38:08
【问题描述】:
当第一个按钮淡出时,我试图淡入第二个按钮。如果您有任何建议,请回复。
$
$(document).on('click',"#firstbutton",function(){
$('#firstbutton').fadeOut("5000", function(){
var div = $("<button id='secondbutton'>Second button</button>");
$('#firstbutton').replaceWith(div).fadeIn("5000", function(){
});
});
});
$(document).on('click',"#secondbutton",function(){
$('#secondbutton').fadeOut("5000", function(){
var div = $("<button id='firstbutton'>First button</button>");
$('#secondbutton').replaceWith(div).fadeIn("5000", function(){
});;
});
});
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id="firstbutton">First button</button>
【问题讨论】:
标签: jquery replace jquery-animate fade