frooty
frooty

Reputation: 212

scrollTop() not working in Chrome browser

function scrollTop () {
  window.scrollBy(0, 100000000000000000);
    $("#entry").focus();
}


   function showChat (nick) {
   $("#toolbar").show();
   $("#entry").focus();

    $("#connect").hide();
    $("#loading").hide();
   scrollTop();
   }

This code not working in chrome browser but it working in Firefox, so how to use scrollTop () in safari, chrome and opera browser.

Upvotes: 1

Views: 462

Answers (2)

Jan
Jan

Reputation: 5815

Why not use

window.scrollTo(0, 0);

?

Upvotes: 3

Vivek S
Vivek S

Reputation: 5540

I tested it in IE 7 and it works, also in FireFox and Chrome...

If this really don't work try using this:

function jumpScroll(amount) {
 document.body.scrollLeft += amount;
}

jumpScoll(100); 

Upvotes: 0

Related Questions