如何获得默认外观 [英] How to get to default appearance

查看:103
本文介绍了如何获得默认外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是对先前发布的问题的跟进。点击这里打开它

我现在有以下代码,但我无法获得看起来采用默认边框和填充的第二个按钮。请帮忙。感谢。

I now have the following code, but I can't get the second button that appears to adopt the default border and padding. Please help. Thanks.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script> 
$(document).ready(function(){
  $("button").click(function(){
    $("#b1").animate({width:'0px', padding:'0', border:'0'}, { duration: 1000, queue: false });
    $("#b2").animate({width:'200px', padding:"", border:""}, { duration: 1000, queue: false });
  });
});
</script> 
<style>
button {
min-width:0px;
height: 22px;
width: 200px;
}

#b2 {
width: 0px;
padding: 0;
border: 0;
}


</style>
</head>

<body>
<button id="b1">Start Animation</button><button id="b2">Animation Done</button>

</body>
</html>


推荐答案

也许你可以像下面这样解决

maybe you can solve like below

css代码:

button {
min-width:0px;
height: 22px;
width: 200px;
}

#b2 {
width: 0px; display:none;
}

jquery代码:

 $("button").click(function(){
     $("#b1").animate({width:'0px',padding:'0px'}, 1000,function(){$('#b1').hide();});
     $("#b2").css('display','inline-block').animate({width:'200px'}, { duration: 1000, queue: false });
  });

您可以在这里看到结果---> http://jsfiddle.net/Junkie/4c9g3/

you can see the result here ---> http://jsfiddle.net/Junkie/4c9g3/

这篇关于如何获得默认外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆