-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add global API to open the Lightbox #66
Comments
"window.lbwpsOpenPhotoSwipeById is not a function" :( |
Yes, because is not implemented yet. This issue only describes how it could be done for future versions, not how it is at the moment. Everybody is invited to provide a pull request ;-) |
Since you are a bit disappointed - sorry, but I maintain this project in my free time and some things don't have a high priority. At https://wordpress.org/support/topic/opening-photoswipe-via-javascript-api/ you also find other solutions like using the For example: on https://arnowelzel.de/en/projects/electronics/brymen-bm257s you can use the following call to open the first image there:
|
I added the code below and nothing happens :(
|
Well - since I don't see the HTML code in which this should be used, just a hint:
|
Also check your web developer console for errors and make sure, that jQuery is available (my plugin does not need jQuery, but your code does). |
Link: |
No errors in the console, jQuery is working. |
Please check the result of this in the console:
|
Then this should open the lightbox:
(Edit: of course without |
Works, thanks :) |
As I said - without Then this should open the lightbox (sorry for the typo):
|
Ok, then your jQuery call may not be correct. But this is something which has nothing to do with my plugin. |
Also see https://wordpress.org/support/topic/opening-photoswipe-via-javascript-api/
There may be usecases which require to open the lightbox without clicking in image. This could be done by exposing a global function. For example:
Where
linkObject
is the image link to open andid
would be the ID. Depending on if you have an object or just an ID you can then use the appropriate function.Usage example:
The text was updated successfully, but these errors were encountered: