468,783 Members | 1,697 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,783 developers. It's quick & easy.

Keyboard navigation in photoalbum

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
2 1914
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
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.

Similar topics

3 posts views Thread by Andrus Moor | last post: by
8 posts views Thread by Yeah | last post: by
2 posts views Thread by michael sorens | last post: by
2 posts views Thread by Samuel Shulman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.