The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

Metronic Auto-Scroll to menu-item


Hi!
I am using version 8.2.2 - demo39 template. If there are many elements, then it is necessary to scroll, but there is no automatic transition to the active one.
If you reduce the size of the screen this can be viewed at -
https://preview.keenthemes.com/metronic8/demo39/widgets/feeds.html
After loading the page, you need to scroll to "Feeds"

To select the active element, I use -

var menuElement = document.getElementById("#kt_app_sidebar_menu");
var menu = KTMenu.getInstance(menuElement);
var activeLink = menu.getLinkByAttribute("12345");
menu.setActiveLink(activeLink);

Please tell me what needs to be added so that the menu scrolls to the active element?

P.S. In Demo1 Everything works.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

 
Deleted comment
Deleted comment
 
Deleted comment
 
Deleted comment
Deleted comment
 
Deleted comment

Hi,

Thanks for the feedback.

In the sidebar HTML code can you try to move id attribute to the child element with class hover-scroll-y. This should enable the auto scroll to the active link on the page load.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.