ashleydw / lightbox

A lightbox gallery plugin for Bootstrap
http://ashleydw.github.io/lightbox
MIT License
1.85k stars 1.3k forks source link

Identify arrows independently of user-defined classes #210

Closed Altreus closed 7 years ago

Altreus commented 8 years ago

We're using fontawesome for all of our icons, not glyphicons, so I set the left and right arrow classes accordingly:

$.fn.ekkoLightbox.defaults.left_arrow_class = ".fa .fa-chevron-left";
$.fn.ekkoLightbox.defaults.right_arrow_class = ".fa .fa-chevron-right";

The CSS, however, assumes that the arrows' classes are not changed:

https://github.com/ashleydw/lightbox/blob/master/dist/ekko-lightbox.css#L46

This means that the right arrow is not visible because the styling is not applied. You can see me pointing at the right-arrow in the element inspector, and where Chromium is rendering it.

ekkolightbox-arrow

I've solved this by always adding ekko-specific classes to the arrows, and referencing those from the CSS.

ashleydw commented 8 years ago

Perhaps the latest branch would be better for you - note how the arrows are now html not classes: https://github.com/ashleydw/lightbox/pull/209 (https://github.com/ashleydw/lightbox/issues/166)