By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Keyboard navigation in photoalbum

P: n/a
Hi!

I've just started to learn PHP, so this may be a dumb quiestion, but I'll
ask it anyway...

Is it possible to create a photoalbum (or make use of such) with PHP,
where I could navigete with my keyboard? When some picture from a gallery
would be selected, could I navigate to next or previous picture by using
for example buttons "n" and "p" from my keyboard? Is this possible to do
with PHP or should I use JavaScript or such instead?

Thanks!

Juha-Markku Liikala
Department of Information Processing Science
University of Oulu, Finland
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Juha-markku Liikala wrote:
Hi!

I've just started to learn PHP, so this may be a dumb quiestion, but I'll
ask it anyway...

Is it possible to create a photoalbum (or make use of such) with PHP,
where I could navigete with my keyboard? When some picture from a gallery
would be selected, could I navigate to next or previous picture by using
for example buttons "n" and "p" from my keyboard? Is this possible to do
with PHP or should I use JavaScript or such instead?


php is server side. Your script has finished execution by the time the
document is displayed.

Javascript can capture keys:

function keypress() {
key = event.keyCode;
}

document.onkeydown = keypress();

Jul 17 '05 #2

P: n/a
On Thu, 20 Nov 2003 14:21:00 +0200, Juha-markku Liikala
<jl******@mail.student.oulu.fi> wrote:
Hi!

I've just started to learn PHP, so this may be a dumb quiestion, but I'll
ask it anyway...

Is it possible to create a photoalbum (or make use of such) with PHP,
where I could navigete with my keyboard? When some picture from a gallery
would be selected, could I navigate to next or previous picture by using
for example buttons "n" and "p" from my keyboard? Is this possible to do
with PHP or should I use JavaScript or such instead?


If you want to use an existing album site, try Opera 7. It can
automatically work out which links are the "previous" and "next" ones.
You can navigate these links by pressing CTRL+ the left and right
arrow keys. I find this feature invaluable for speedy browsing of
search results from Google, eBay, etc.

If you're writing one and want to add this feature, try adding LINK
elements in your <head> thus:
<link rel="prev" href="album.php?page=4">
<link rel="next" href="album.php?page=6">

Some browsers may allow keyboard navigation of these links.

I was also going to suggest using the accesskey attribute, but from
what I've read it appears poorly supported and inconsistently
implemented.

--
David ( @priz.co.uk )
The Internet Prisoner Database: http://www.priz.co.uk/ipdb/
The Tarbrax Chronicle: http://www.tarbraxchronicle.com/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.