如何在悬停时流畅地对引导程序进行动画处理
How to smoothly animate a Bootstrap well on hover?
好的,所以我必须在将鼠标悬停在它上面时显示按钮来展开well
。
我已经设法做到了,但扩张非常突然(你知道,就像突然出现和消失一样)。
我想问一下如何对悬停进行动画处理以使悬停更具吸引力。
这就是我现在拥有的:
var origWell= $('#NoteWell').html();
$("#NoteWell").hover(function(){
$(this).html(originalContent + '<div type="button" class="btn btn-danger btn-md" title="Stop" data-content="Stop Note Conversion" onclick=stopNote()>Stop</div>');
}, function(){
$(this).html(origWell);
});
相关的 HTML(根据要求)基本上是:
<div class="container">
<div id="Currencies" class="row" align=center>
<a data-toggle="tab" href="#Notes"><div id="CurrencyWell" class="well well-sm col-sm-2"><h4>Notes<br><span id="note">0</span></h4></div></a>
</div>
你可以
使用jQuery幻灯片或淡入淡出效果(slideIn()
,slideOut()
/fadeIn()
,fadeOut()
)
$("#NoteWell").hover(function() {
$(this).find('button').slideDown();
}, function() {
$(this).find('button').slideUp();
});
$("#NoteWell2").hover(function() {
$(this).find('button').fadeIn();
}, function() {
$(this).find('button').fadeOut();
});
html {margin:2em;}
#NoteWell button, #NoteWell2 button {
display: none;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="NoteWell" class="well">
Button slides up/down
<button type="button" class="btn btn-danger btn-md" title="Stop" data-content="Stop Note Conversion" onclick="stopNote()">Stop</button>
</div>
<div id="NoteWell2" class="well">
Button fades in/out
<button type="button" class="btn btn-danger btn-md" title="Stop" data-content="Stop Note Conversion" onclick="stopNote()">Stop</button>
</div>
相关文章:
- Html引导程序警报自动关闭困难
- 引导程序:在导航栏中,显示悬停在单个位置的基于Li Link的不同内容
- Twitter引导程序Typeahead-Id&标签
- 引导程序崩溃一次只能看到一个
- 引导程序/基础堆叠行/列
- 如何保持引导程序下拉复选框列表下拉
- .aspx页面上引导程序中的动态选项卡
- 菜单栏class=活动引导程序主题无法正常工作
- 为什么引导程序下拉菜单只有在包含bootstrap-responsive.css时才起作用
- 如何在引导程序元素的顶部添加掩码
- 如何平滑地设置twitter引导程序进度条的动画
- 如何在模式弹出窗口中使用引导程序日期和时间选择器
- 引导程序转盘不工作:堆叠图像(使用rails)
- datepicker引导程序再次初始化
- KnockoutJS处理引导程序日期选择器和日期格式
- 在单击外部 Via 挖空绑定处理程序时,从引导程序 3.3.6 关闭弹出框
- 如何在悬停时流畅地对引导程序进行动画处理
- 如何处理onclick,即使在引导程序多选中也是如此
- 如何处理引导程序按钮下拉列表中的单击事件
- 在ui引导程序typeahead中处理具有有意义键的对象