2015-10-14 27 views

回答

0

我想你的报价框的CSS是这样

#quote-icon{ 
position: fixed; 
top: 0; 
} 

尝试并添加

<script type="text/javascript"> 
$(document).ready(function() { 
var top = $('#quote-icon').offset().top - parseFloat($('#quote-icon').css('marginTop').replace(/auto/, 0)); 
$(window).scroll(function (event) { 
    var y = $(this).scrollTop(); 
    //if y > top, it means that if we scroll down any more, parts of our element will be outside the viewport 
    //so we move the element down so that it remains in view. 
    if (y >= top) { 
     var difference = y - top; 
     $('#quote-icon').css("top",difference); 
    } 
}); 
}); 
</script> 
1

我猜你希望它是固定的...所以:position: fixed;可能帮助。