Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightbox images goes loop #24

Closed
Fabbryzz opened this issue Jul 27, 2015 · 8 comments
Closed

lightbox images goes loop #24

Fabbryzz opened this issue Jul 27, 2015 · 8 comments

Comments

@Fabbryzz
Copy link

Hi, you made a very good plugin!
But I have a problem that I really don't understand. When I click on the images thumbs, the overlay with loader and navigation icons appear, but the images that I would open in lightbox goes loop. i checked the paths and I tried also with external images link, but it don't work.
This is the link of my test page: http://fabbryzz.it/test/lightcase.js/
Can you help me to find the matter? Thanks a lot!

@cbopp-art
Copy link
Owner

Hi @Fabbryzz
You have a javascript error which can be seen inside the browser console log.
So, when I look to your code where you initialize lightcase, I can see that you passed the arguments (settings) in a wrong way and invalidates your javascript. Actually, arguments needs to be passed within round braces of your lightcase.() function call.

It should look like this:

jQuery(document).ready(function($) {
        $('a[data-rel^=lightcase]').lightcase({'swipe': true});
});

If you have swipe: true you wouldn't need to define it because true is the default. See docs.

Hope this fixes your issue!

@Fabbryzz
Copy link
Author

Thanks for your quick reply cbopp-art, I made a beginner's mistake.. now I have correct the code removing {'swipe': true}, and it seems the code is clean, but it still doesn't work..

@cbopp-art
Copy link
Owner

Try to use double quotes " for your data-rel selectors. Something like this:

$('a[data-rel="lightcase:myCollection:slideshow"]');

@Fabbryzz
Copy link
Author

mmh.. nothing to do.. it still doesn't work.. It's a really weird thing.. :-\

@cbopp-art
Copy link
Owner

Could you try with a stable version of jquery (e.g. 2.1.4)?
It also could be that lightcase now got an incompatibility with the new jQuery version or jQuery 3.0.0-alpha which you are using is buggy yet.

@cbopp-art
Copy link
Owner

@Fabbryzz
No! It seems that the element can't get found:
you need to wrap your call for instance with

jQuery(document).ready(function($) {
 // Call lightcase only if DOM is ready
});

@Fabbryzz
Copy link
Author

I have changed jquery version to 2.1.4 and now it works..!
I have also retrieve the rest of the code at the original version (data-rel without quotes)
The instance - jQuery(document).ready(function($) {... - was already present in the original code, so I don't change nothing else.
It seems that version Alpha of jQuery was the only matter.
Thanks cbopp-art! You've been a great help! ;-)

@cbopp-art
Copy link
Owner

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants