dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.39k stars 3.48k forks source link

Make slide image clickable with specific link #914

Open DeoThemes opened 8 years ago

DeoThemes commented 8 years ago

Hello,

I was trying to make it by myself, but don't have enough JS knowledge. So basically I have simple image gallery and after popup opens the image should be a link to a single project page.

The project page can be project-1.html, project-2.html etc. so it's dynamic and that's where I stuck. I tried to add custom markup like `''+

'+ '
' ` But how to make this link dynamic, based on what slide is opened. Any help would be appreciated, Thanks.
alpha-kappa commented 8 years ago

If you have a variable with name(href) of a project than insert it to the link tag: var srcCurrentProject = '/project.html', linkToProjectHTML = '<a href="' + linkToCurrentProject + '">'+ <div class="mfp-img"></div>'+ '</a>'

DeoThemes commented 8 years ago

If you have a variable with name(href) of a project than insert it to the link tag: var srcCurrentProject = '/project.html', linkToProjectHTML = ''+

'+ ''

Thanks for the try, but I can't make it working. And my project link can be always different, depending what slide is on the display.

Thanks.

alpha-kappa commented 8 years ago

Show your code.

DeoThemes commented 8 years ago

http://codepen.io/DeoThemes/pen/GjGXwg