Skip Navigation

[Résolu] views slider navigation using keys (keyboard left and right arrows)

This support ticket is created Il y a 3 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par stuart Il y a 3 années et 5 mois.

Assisté par: Minesh.

Auteur
Publications
#2080005

I have a view that is basically a power point presentation replica, wheat I would like to be able to do is have the view navigable by either the left and right keyboard arrows for the pagination. ad or the mouse scroll wheel if that is what they want.

is this possible?

thanks

#2080031

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Updated:
I have discuss this again and it seems you are using the classic views not blocks and to add such feature that supports keyboaard left and right arrows you will have to write the custom javascript code.

#2086323

I found a solution, it does not give the same transition effect and feels slower than if i used the native click navigation, but here it is in case anyone else needs it.

jQuery(document).ready(function($){
<!-- Start of Function -->
$(document).keydown(function(e) {
  var prevPageLink = $( ".js-wpv-pagination-previous-link" ).attr('href');
  var nextPageLink = $( ".js-wpv-pagination-next-link" ).attr('href');
  switch(e.which) {
    case 37:
      if ( prevPageLink ) {
        window.location = prevPageLink;
      }
      break;

    case 39:
      if ( nextPageLink ) {
        window.location = nextPageLink;
      }
      break;

    default: return;
  }
  e.preventDefault();
});

<!-- END of Function -->
}); 


#2086325

in-case anyone else needs to save time here is what i managed... its not got the same slide transition for some reason and there feels like a lag that i am going to try and work out...but it does work.

jQuery(document).ready(function($){
<!-- Start of Function -->
$(document).keydown(function(e) {
  var prevPageLink = $( ".js-wpv-pagination-previous-link" ).attr('href');
  var nextPageLink = $( ".js-wpv-pagination-next-link" ).attr('href');
  switch(e.which) {
    case 37:
      if ( prevPageLink ) {
        window.location = prevPageLink;
      }
      break;

    case 39:
      if ( nextPageLink ) {
        window.location = nextPageLink;
      }
      break;

    default: return;
  }
  e.preventDefault();
});

<!-- END of Function -->
});