Dropdown ScrollTop

30 views
Skip to first unread message

Emilio Amado

unread,
Jan 20, 2020, 4:37:31 AM1/20/20
to GWT-Bootstrap
Hi folks,I need some help with Bootstrap dropwon element. 

I'm developing a calendar component, when I display a "bootstrap dropdown" whit the years, I'm trying to set the vertical scroll bar of the dropdDown to a specific position when it's opened. When I open the dropdown for the first time, I want to scroll the bar to the position of the element that shown in the "years" button.

As you can see in the following picture, the first time that I open the dropdown, I displaying the "2020" value in the button element, but the scroll It's in the top position:

calendar1.png

What I want is set the position of the scroll bar to the "2020" year position.


This is the complete code:
https://jsfiddle.net/wx31qjvk/

I tried to use "scrollTop" in the "hlCurrentYear()" function without success.

Thank you very much for your help

Greetings, Emilio.

Carlos Alexandro Becker

unread,
Jan 20, 2020, 9:31:45 PM1/20/20
to GWT-Bootstrap
This forum is for http://gwtbootstrap.github.io/, which has no affiliation with bootstrap itself.
Reply all
Reply to author
Forward
0 new messages