Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anchor Jumping across the section within page

I am trying to implement "Anchor Jumping" functionality using JavaScript and Angular 2 in my application, Means user can jump across the section within a page.

As per the client requirement, User can jump(Navigate) the section using of pressing Ctrl+Shift+Left/Right Arrow key.

Here, I add one snap to clear out the question as below.

enter image description here

As an example, Suppose first time focus on Menu and user press the Ctrl+Shift+Right Arrow at that time focus should be go to next element item(i.e. Breadcrumb section or any section).

I am very confuse about, How to manage the dynamic loading content? (How can I count this dynamic content in my section?)

Please suggest any idea to achieve this functionality.

like image 254
Dipak Delvadiya Avatar asked May 23 '17 12:05

Dipak Delvadiya


People also ask

How do you create links to sections within the same page?

To do this, position your cursor on the page where you would like the link to appear, and then go to Insert > Link. In the window that appears, enter the text you would like to appear as a link, and in the URL Field, enter #targetname, where targetname is the name of your target.


1 Answers

What you need is a focus manager. I wouldn't bother writing one from scratch, Angular Focus Manager is one example of how to solve this problem. It also incorporates Mousetrap.js, which adds shortcut directives.

Your dynamic content can always be wrapped in something (even a div) that has its focus managed.

I hope this helps!

like image 177
hector-j-rivas Avatar answered Oct 16 '22 16:10

hector-j-rivas