views:

62

answers:

1

I have a function that fires when the scroll bar hits the bottom. For some reason now, IE is firing the event twice. It wasn't doing it before. I don't have a duplicate function, and not have the JS declared twice. It's fine in Opera, FF, Chrome. I don't know why it's doing so in IE. Oh how I hate M$ and this troublesome browser.

jQuery(document).ready(function(){          
        jQuery(window).scroll(function(){
            if  (jQuery(window).scrollTop() == jQuery(document).height() - jQuery(window).height()){
               scrollPost();
            }
        }); 

    });

Edit: Actually it's double posting in Safari too. Another browser I don't like.

+3  A: 

I found the solution here.

http://stackoverflow.com/questions/2087620/jquery-scroll-hits-twice-on-ie

Apparently IE and Safari are known for this issue. I had to use the debounce method to keep it from firing twice. I used Ben Alman's dotimeout plugin and it worked pefectly fixing the IE and Safari issue.

Pjack