views:

56

answers:

2

I need to make this function work everywhere, except IE6-7

$(function(){
    window.scrollTo(0,300);
})

Please help.

+3  A: 

You could link in broswer detect and then do something like:

$(function() {
   if (!($.browser.msie() && $.browser.version.number() < 8)) {
      window.scrollTo(0,300);
   }
}

I suppose the better question is why do you need this? Read more about object detection instead.

gnarf
+1  A: 

This is the construct that you're after I think:

if (!(jQuery.browser.msie)) { window.scrollTo(0,300); }

Bayard Randel