wa-mediabox | Modern lightbox without jQuery and with iframe support | Plugin library
kandi X-RAY | wa-mediabox Summary
kandi X-RAY | wa-mediabox Summary
Modern lightbox without jQuery and with iframe support. GALLERIES / PAGINATION / IFRAME / YOUTUBE VIDEOS / RESPONSIVE / MODERN DESIGN.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wa-mediabox
wa-mediabox Key Features
wa-mediabox Examples and Code Snippets
Community Discussions
Trending Discussions on wa-mediabox
QUESTION
I'm using a JavaScript
library lightbox
without jQuery in an external js file, and I want to configure a button there to link to several different URLs (Clicking on button 1 would open link 1, clicking on button 2 would open link 2).
I got the button to open a new window using window.open('link1.html', '_blank')
.
However I couldn't figure out how to to define several different target URLs, preferably in the body of my code.
Is it possible to configure it in a way, that the window.open
function would fetch different target URLs back in the body?
It is this lightbox: https://jiri.hybek.cz/wa-mediabox/ which runs completely on an external js file, and only the images are defined in the body as follows:
...ANSWER
Answered 2017-Dec-30 at 21:10I have two solutions for you, one is kind of hacky, but it's a single line change, the other is more elegant, but requires a few more modifications. Note that I am making the changes to the original JavaScript source file (non-minified).
For both of these solutions, the HTML will be the same; you add a data-custom-url
attribute to the tag and set the value to whatever page you want to open for that image:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wa-mediabox
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page