/    Sign up×
Community /Pin to ProfileBookmark

Scrolling Divs & Key Events

Ok, I’m not sure if this is possible, but I want to see what everyone’s approach would be.

I have a little button on my page labeled “Category Chooser”, and when you click it, a scrolling div pops up and is populated with available categories from a DB. Something like this:

[CODE]

<div style=”height: 400px; width: 100px; overflow: auto;”>

<input type=”checkbox”>a</input>

<input type=”checkbox”>b</input>

<input type=”checkbox”>c</input>

<input type=”checkbox”>d</input>

</div>
[/CODE]

but I have lots and lots of categories in alphabetical order….

Would it be possible to have some sort of script that listened for key events — and lets say I press the letter ‘s’, the scrolling div would jump down to the first option that begins with the letter ‘s’?

Not sure if this can be done, or if there are any other options. Bascially I’m trying to speed up the selection process for my users, because this list is rather lengthy… and the user HAS to be able to pick multiple categories. I am aware that <select> elements do this, but I have limited real-esate on the page, and multiple selects just aren’t going work.

Thanks in advance.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@PadonakMar 07.2007 — is it what you need? [url=http://www.fisioterapiautebo.com/padonak/ajax/samples/quan/key_scroll.htm]link[/url]
×

Success!

Help @nrjCL spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...