Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:01:09+00:00 2026-06-09T13:01:09+00:00

So I am working on a keyboard forward- and back-script like they have on

  • 0

So I am working on a keyboard forward- and back-script like they have on Tumblr and 9GAG (you can navigate the posts using your J and K keys).

My approach:

User presses J (next) key

Javascript uses JQuery Viewport to find out which "Jump"-ID is currently in:viewport

Javascript adds +1 to the "Jump"-ID

Javascript gets the position of the increased "Jump"-ID, scrolls there

Now the problem is the following:

<div class="content jump" id="<?php echo $id; ?>">

I already defined the id of the div. So it looks like this:

<div class="content jump" id="1225">
<div class="content jump" id="1299">
<div class="content jump" id="1206">
<div class="content jump" id="1345">

However, in order to be able to jump in the right order I somehow need to store an additional identification, maybe like this…

<div class="content jump" id="1225" jump="1">
<div class="content jump" id="1299" jump="2">
<div class="content jump" id="1206" jump="3">
<div class="content jump" id="1345" jump="4">

That’s just my imagination. There should be a way around this. If you have a better solution to the J / K problem, you are also free to tell me (maybe Tumblr or 9GAG has a much better one?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:01:10+00:00Added an answer on June 9, 2026 at 1:01 pm

    You can use data- attributes. For example:

    <div class="content jump" id="1225" data-jump="1">
    

    You can then fetch that data by using

    $('#1225').data('jump');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get a USB HID keyboard working on an Android
I have defined keyboard events which is working good in desktop but for touch
I'm working on a project in emacs where I'd like to use a keyboard
I am working on iphone application in which i have to return the keyboard
I have been working on a Ruby Script that enters in data into a
i am working in an application and I press key from keyboard, how can
Keyboard Enter key not working in MFC Dialog Box ? I have one MFC
The program is working at background and listening keyboard(like keylogger) First I select a
In the application I'm working on I'd like to listen for when the keyboard's
The program I'm working on a virtual keyboard of sorts that requires unicode. Using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.