この .side_content_wrapper を、ユーザーがページをスクロールしてバックアップした距離に基づいて、固定または静的にしようとしています。IE8+/chrome/firefox で問題なく動作しています。しかし、何らかの理由でIE7で動作させることができません。私は何か間違ったことをしていますか?
助けてくれてありがとう!
$(window).scroll(function(e){
var scrollAmount = $(window).scrollTop();
var documentHeight = $(document).height();
var heightFromBottom = documentHeight - scrollAmount;
$el = $('.side_content_wrapper');
if((scrollAmount > 320 && heightFromBottom > 950) && $el.css('position') != 'fixed') {
fixToScroll();}
else if (scrollAmount < 320 && $el.css('position') == 'fixed') {
fixToStatic();}
if(heightFromBottom <= 950 && $el.css('position') == 'fixed') {
fixToBottom();}
else if((heightFromBottom > 950 && scrollAmount > 320) && $el.css('position') == 'fixed') {
fixToScroll();}
function fixToScroll() {
$('.side_content_wrapper').css({'position': 'fixed', 'top': '35px', 'right': '218px'});
}
function fixToStatic() {
$('.side_content_wrapper').css({'position': 'static', 'top': '0px', 'right': '0px'});
}
function fixToBottom() {
$('.side_content_wrapper').css({'position': 'fixed', 'bottom': '400px', 'top': 'inherit', 'right': '218px'});
}
});