Member
Member
Ruriko   2012-09-26, 09:59
#1
I am using the keyboard plugin here http://www.zenphoto.org/news/keyboard-plugin I installed and activated and I tried testing but it doesn't work. I can't use the left & right keyboard to navigate images.

Is there another plugin that can navigate images using the keyboard?
Administrator
Administrator
acrylian   2012-09-26, 19:16
#2
No, all known are listed there. I don't know that one but it might require adjustments depending on the theme.

You can try this jQuery javascript code on a normal theme's image.php:
`
$(function() {
$(document).keyup(function (event) {
if (event.keyCode == 37) {
// Links
<?php if (hasPrevImage()) { ?>
window.location.href="<?php echo getPrevImageURL(); ?>";
<?php } ?>
} else if (event.keyCode == 39) {
// Rechts
<?php if (hasNextImage()) { ?>
window.location.href="<?php echo getNextImageURL(); ?>";
<?php } ?>
}
});
});
`
Member
Member
Laurent   2012-09-26, 21:31
#3
Oups !

Can you download it again and report here please. I made a few change.
Member
Member
Ruriko   2012-09-27, 00:00
#4
Thanks the plugin is now working Smile
Member
Member
pvankempen   2012-10-20, 00:54
#5
The keyboard-plugin worked fine for me right away ... for images (i.e. in the image.php page). But I was surprised it didn't also handle left/right arrows in the album.php page (to navigate between albums). I got that working by making a minor change to the plugin:

`
if ($_zp_gallery_page = 'album.php') {
<?php if (getNextAlbum()) { ?>var nextURL="<?=getNextAlbumURL();?>";<?php } ?>
<?php if (getPrevAlbum()) { ?>var prevURL="<?=getPrevAlbumURL();?>";<?php } ?>
}
if ($_zp_gallery_page = 'image.php') {
<?php if (hasNextImage()) { ?>var nextURL="<?=getNextImageURL();?>";<?php } ?>
<?php if (hasPrevImage()) { ?>var prevURL="<?=getPrevImageURL();?>";<?php } ?>
}
`
Member
Member
Laurent   2012-10-20, 14:17
#6
Yes, you're right.
i can include your change in the file if you are ok.
Member
Member
pvankempen   2012-10-20, 20:06
#7
Sure, feel free to include it.
Member
Member
Laurent   2012-10-21, 14:13
#8
Thank you,

Your change as been include in the file.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.