javascript 如何在javascript中缓慢隐藏div
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23261899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 00:38:40 来源:igfitidea点击:
How to hide div slowly in javascript
提问by Atif Azad
回答by Roman
http://jsfiddle.net/ssZXA/185/
http://jsfiddle.net/ssZXA/185/
read the documentation about .hide()
the first argument is "duration"
阅读有关.hide()
第一个参数的文档是“持续时间”
You can use $("#notice").hide('slow');
您可以使用 $("#notice").hide('slow');
回答by Somnath Kharat
回答by D Mishra
Use
利用
$("#notice").slideToggle();
or
或者
$("#notice").fadeOut();
In Place of
代替
$("#notice").hide();
回答by Raja Danish
Plz try this:
请试试这个:
$("#notice").hide("slow");
Thanks.
谢谢。
回答by Siva Charan
回答by Jayesh Goyani
Try with this.
试试这个。
<body>
<div id="myDiv" style="width:200px;height:150px;background-color:red;">
This is the div that will fade out, slide up, then be removed from the DOM.
</div>
<input id="myButton" type="button" value="Fade" />
</body>
$(function() {
$("#myButton").click(function() {
$("#myDiv").fadeTo("slow", 0.00, function(){
$(this).slideUp("slow", function() {
$(this).remove();
});
});
});
});
回答by Tuhin
回答by Amit Joki
回答by test
$(function(){
$(this).html('«');
$('.slider-arrow').click(function(){
var x = $(".slider-arrow").offset();
if (x.left == "308")
{
$( ".slider-arrow, .panel").animate({left: "-=300"}, 700);
}
else
{
$( ".slider-arrow, .panel").animate({left: "+=300"}, 700);
}
});
});