Title: Auto scroll
Last modified: August 16, 2019

---

# Auto scroll

 *  [damians20171](https://wordpress.org/support/users/damians20171/)
 * (@damians20171)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/)
 * Hi, I have one problem with my page. I would like to get effect of auto scrolling
   down. I mean after page loaded I want to page slowly scroll down to the bottom.
   It should be only on posts with certain category. Something like you can see 
   in shop’s TV which are used to present some ad. Thank you in advance

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/#post-11839623)
 * Like the example at [http://jsfiddle.net/BjpWB/4/](http://jsfiddle.net/BjpWB/4/)?
 * That example uses a click action, but the effect can be triggered by any JS action,
   such as `window.onload`. The example is generic and not specific for WP. jQuery
   needs to be available on the page. You could conditionally output something like
   the following only when the return of `wp_get_post_categories()` contains the
   category in question:
 *     ```
       <script>
       function scrollToAnchor(aid){
           var aTag = jQuery("a[name='"+ aid +"']");
           jQuery('html,body').animate({scrollTop: aTag.offset().top},'slow');
       }
       window.onload = scrollToAnchor('id3');
       </script>
       ```
   
 *  [pythondict](https://wordpress.org/support/users/pythondict/)
 * (@pythondict)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/#post-11854108)
 * Try animate.css
    [https://daneden.github.io/animate.css/](https://daneden.github.io/animate.css/)
 *  Thread Starter [damians20171](https://wordpress.org/support/users/damians20171/)
 * (@damians20171)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/#post-11878362)
 * Thank you. [@bcworkz](https://wordpress.org/support/users/bcworkz/) your solution
   is good. I used another solution which is just to make some button or link on
   a page which scroll page to specific id on the bottom of page.
    `<a href="#id"
   >` This button or link is clicked automatically after page loaded. I made 2 functions.
   1 is just to setTimeout so 2 function can wait 3 secounds to page full load.
 *     ```
       function function1() {
           console.log('Welcome to My Console,');
       }
   
       function1();
   
       setTimeout(function2, 3000);
   
       function function2(){
   
         document.getElementById("id").click();
   
   
       };
       ```
   
 * Thanks for help 😉
    -  This reply was modified 6 years, 9 months ago by [damians20171](https://wordpress.org/support/users/damians20171/).
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/#post-11880539)
 * Nice! I’m glad you found something you like. You’re welcome.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Auto scroll’ is closed to new replies.

## Tags

 * [auto scroll](https://wordpress.org/support/topic-tag/auto-scroll/)
 * [page scroll](https://wordpress.org/support/topic-tag/page-scroll/)
 * [scroll](https://wordpress.org/support/topic-tag/scroll/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/auto-scroll-3/#post-11880539)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
