Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In jQuery is there way for slideDown() method to scroll the page down too?

Tags:

jquery

The slideDown() applied to a div element does the slide down, but doesn't scroll the page down and the div slided down div remains hidden from view.

Is there a way to scroll the page down as well so the user can view the div?

like image 927
Malik Daud Ahmad Khokhar Avatar asked Jan 23 '09 13:01

Malik Daud Ahmad Khokhar


1 Answers

Quick demo here

Basically all you need is

 $('html, body').animate({ 
      scrollTop: $('#yourDiv').offset().top 
  }, 3000); 
like image 135
redsquare Avatar answered Sep 29 '22 23:09

redsquare