Bind left / right to previous / next page.

This commit is contained in:
Sébastien Lucas 2012-10-11 21:43:37 +02:00
parent 008ac70dc3
commit d28552a485

View file

@ -104,6 +104,26 @@
return false; return false;
}); });
}); });
<?php
if ($currentPage->isPaginated ()) {
$prevLink = $currentPage->getPrevLink ();
$nextLink = $currentPage->getNextLink ();
?>
$(document).keydown(function(e){
<?php
if (!is_null ($prevLink)) {
echo "if (e.keyCode == 37) {\$(location).attr('href','" . $prevLink->hrefXhtml () . "');}";
}
if (!is_null ($nextLink)) {
echo "if (e.keyCode == 39) {\$(location).attr('href','" . $nextLink->hrefXhtml () . "');}";
}
?>
});
<?php
}
?>
</script> </script>
</head> </head>
<body> <body>
@ -220,8 +240,6 @@
</div> </div>
<?php <?php
if ($currentPage->isPaginated ()) { if ($currentPage->isPaginated ()) {
$prevLink = $currentPage->getPrevLink ();
$nextLink = $currentPage->getNextLink ();
?> ?>
<div class="foot"> <div class="foot">
<div class="footcenter"> <div class="footcenter">