Mike
Mike

Reputation: 1863

Browser support

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

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

Please help.

Upvotes: 0

Views: 142

Answers (2)

Bayard Randel
Bayard Randel

Reputation: 10086

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

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

Upvotes: 1

gnarf
gnarf

Reputation: 106332

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.

Upvotes: 4

Related Questions