【发布时间】:2014-10-11 08:17:35
【问题描述】:
我的新网站有问题。我有一个 div 用作“页面顶部的按钮”。
当我用滚轮鼠标向下滚动时,div 出现但它的位置向右改变(并出现一个滚动条)。我只有 ie 11 才有这个问题...
奇怪...还是不奇怪,我不知道,我已经搜索了几天了,但我什么也没找到。
我的 CSS:
#btn_up
{
display: block;
width: 100px;
height: 100px;
background-image: url(../img/pagetop.svg); background-repeat: no-repeat;
position: fixed;
bottom: 15px;
right: 25px;
z-index: 1000;
cursor: pointer;
display:none;
}
还有我的javascript:
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('#btn_up').fadeIn();
} else {
$('#btn_up').fadeOut();
}
});
$('#btn_up').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
});
我错过了什么???
【问题讨论】:
-
来吧伙计们,我不着急但不知道会杀了我!
标签: scroll fixed internet-explorer-11