简体   繁体   中英

Autoscroll for an internal scrollbar in a div element

I'm trying to do an autoscroll through javascript of an internal div which as the function of scrollbar.

Here the html snippet code:

<div class="scrollpane" style="display: block;">
<div class="scrollbar" style="transform: translate(0px, 0px); height: 25px;"></div>
</div>

With the following script I'm able to move the scrollbar on the bottom (0px, 200px) but still doesn't load the data.

var scrollbar=document.querySelectorAll('div.scrollbar'); scrollbar[0].setAttribute('style','transform: translate(0px, 200px); height: 25px;');

What am I missing here? Maybe some event that must be fired? Thank you.

enter code here Demo:
http://jsfiddle.net/subhash9/fRUUd/1511/ Code $(".scrollbar").animate({ scrollTop: 1000 }, 2000);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM