1
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.

Furqan Safdar
  • 16,260
  • 13
  • 59
  • 93
frooty
  • 202
  • 1
  • 2
  • 11

2 Answers2

3

Why not use

window.scrollTo(0, 0);

?

Jan
  • 5,688
  • 3
  • 27
  • 44
0

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); 
Vivek S
  • 5,384
  • 8
  • 51
  • 72