jackmoore / colorbox

A light-weight, customizable lightbox plugin for jQuery
http://www.jacklmoore.com/colorbox/
MIT License
4.75k stars 1.14k forks source link

No arrowKey on jQuery Colorbox Wordpres Plugin #879

Open danjde opened 5 years ago

danjde commented 5 years ago

Hi Devs! I'm using jQuery Colorbox Wordpres Plugin. Using some photos on the same into another container plugin, I'm not able to show the arrowkey. I've check jquery.colorbox.js and it's seem ok:

arrowKey: true,

What I should do for enable arrow key or verify some issues on this situation? PS if you like I can show page URL

Many thanks

Davide

jackmoore commented 5 years ago

Hey Davide, this is the repository for Colorbox, but not for the Wordpress plugin which uses Colorbox as a foundation. I can't speak for any Wordpress plugin specific issues, but if the previous/next arrows aren't showing up on your images, then that's probably because they haven't been grouped together.

The arrowKey setting is only for allowing / disallowing the use of keyboard arrow keys to cycle within elements of the group, but has nothing to do with grouping itself. It sounds like you need to indicate to Colorbox which items you want grouped together.

When you assign Colorbox to an element, you can either group the links together using the rel attribute, or data-rel attribute, or by passing Colorbox a rel value for a certain group of in-page elements.

Here is an example of using the data-rel attribute:

<a href='1.jpg' class='gallery' data-rel='vacation'>Pic 1</a>
<a href='2.jpg' class='gallery' data-rel='vacation'>Pic 2</a>
<script>$('.gallery').colorbox();</script>

Here is an example of using Colorbox's rel setting:

<a href='1.jpg' class='gallery'>Pic 1</a>
<a href='2.jpg' class='gallery'>Pic 2</a>
<script>$('.gallery').colorbox({rel: 'vacation'});</script>

Good luck, I hope that helps.