Arrow keys for project navigation
-
Hi,
I want to use arrow keys for going next or previous projects. So I found and added some custom html and it works nice. I go to next project when I press right key and left for previous. Perhaps this can be added easily to lay theme.
I have Prev and Next links on my page already so I use them to JS click function.
You have to add id to your Next and previous links like #previousarrlink and #nextarrlinkJs:
<script type="text/javascript">
document.addEventListener("keyup",function(e){
var key = e.which||e.keyCode;
switch(key){
//left arrow
case 37:
document.getElementById("previousarrlink").click();
break;
//right arrow
case 39:
document.getElementById("nextarrlink").click();
break;
}
});
</script>Project arrows function can have this as an addition too.
Best. -
Hi dgknkrpnr!
Ah! Sweet! I will tell Armin and will add it in our "list-for-the-future"!
Thank you a lot!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it