Search code examples
jqueryhtmlfotorama

Fotorama wrap base image with <a> linking external page onclick


I've been searching around the posts about Fotorama gallery and have seen some simillar questions but it looks no one of them fits my case.

What I need is clicking the image instead of switching to the next one to open a new webpage like a hyperling usually does. Wrapping the with an tag didn't help at all:

<div class="fotorama"
     data-width="100%"
     data-fit="cover"
     data-click="false"
     data-swipe="false" 
     data-nav="none">
      <a href="The link to an external page">
             <img src="My image url">
      </a>
</div>

Thanks for your time in advance, and take my excuses if I repeat already a question. If so, please refer me to it.

*** PS: I'm not talking about the thumbnail images but for the main ones.`


Solution

  • Ok, that one wasn't so difficult. Looking around the solutions Andrey Okonetchnikov gave in the GitHub section of the project I've ended up with this sollution which totally worked for me.

    I hope this refference will be usefull for someone of you too! Happy coding ^^

    jsfiddle.net/artpolikarpov/8tjrJ/