I would like my
div="#course_navigation"
in my sidebar with this css:
.sidebar #course_navigation {
max-height: 700px !important;
overflow-y: auto !important;
overflow-x: hidden !important;
}
to scroll to this class on page load:
.learndash-current-menu-item
I try this, but nothing happens:
$('#course_navigation').scrollTo('.learndash-current-menu-item');
I have tried many other codes, with no success. Don't know the problem is.
The structure looks like this:
Maybe I was not specific enough, so I repeat:
#course_navigation
is scrollable.
I need #course_navigation scrolled until .learndash-current-menu-item can be seen at the top or center of #course_navigation on page load.
I have this at field of Theme Space before /head:
<script src="code.jquery.com/jquery-1.10.2.js"></script>;
I put the script to Space before /body like this:
<script>$('#course_navigation').scrollTo('.learndash-current-menu-item');</script>
No succes yet, nothing happens, none of the solution works...
Please help me out here with JS or jquery. The best should be scroll the element to the center of the div.
Thank you in advance!
András