[英]floating action button is not working?
The problem I'm having is that when am click on button it should be come to top and floated. 我遇到的问题是,当我单击按钮时,它应该位于顶部并浮动。 come to top is working but it not floated..can anyone suggest me for this problem...... 来到顶部正在工作,但没有浮动..有人可以建议我解决这个问题吗...
code like bellow 像下面的代码
<div class="create-course-info" id="scroll">
<a href="#" ><span class="count"><i class="fa fa-angle-up"></i></span>
</a>
</div>
css like bellow CSS像波纹管
.create-course-info {
position: relative;
min-height: 50px;
margin-bottom: 30px;
padding: 10px;
}
.create-course-info .count {
display: inline-block;
width: 50px;
height: 50px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
text-align: center;
line-height: 44px;
font-family: 'Lato', sans-serif;
font-size: 24px;
float: right;
border: 3px solid #37abf2;
background-color: #eee;
color: #666;
}
.fa-angle-up:before {
content: "\f106";
}
script code 脚本代码
<script type='text/javascript'>
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('#scroll').fadeIn();
} else {
$('#scroll').fadeOut();
}
});
$('#scroll').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.