Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

How to have clickthrough link on gallery but not on individual photos


JoseMartinez97

Question

Site URL: https://www.jmarz.art/portraits

Password: SuperSecretePassword

Hey all, I'm a c/c++ programmer, done a bit of kotlin for two apps I've developed and dabbled in a few other languages due to needed to be able to...and I guess this is one of those moments. I never was one for javascript, html, or anything of the sort so sorry for my limited knowledge but how would one go about setting a clickthrough link via an image in the gallery so that a user can be redirected to the gallery link. This sort of works on the first gallery (Forest Collection // 01) but then I have a unintentional loop once I get to https://www.jmarz.art/forestcollection01 . Every time I click on the the first photo (first is the top left photo) it'll go to the clickthrough link again which is what I am trying to get rid of. The intended flow I'm trying to achieve is:

  • User goes to https://www.jmarz.art/portraits - in which they can see a series of photography sessions
  • User clicks on a session of interest, which would lead them to that session. If the session of interest was Forest Collection // 01, then they would be sent to https://www.jmarz.art/forestcollection01
  • Once here, the user could click on the top left most picture (the first one) and start viewing the collection. In reality the user could click on any at this point an view the collection, but they all must allow the user to view the collection, not have a clickthrough link that basically just takes them to the same URL.
Link to comment
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Thus far I've made something work, but it's definitely not scaleable. 

 

<script>
window.onload = function(){

    /*********Forest**************/
document.getElementById('forestcollection01-section').addEventListener("click",         function(event) {
    
      window.location.href =     'https://www.jmarz.art/forestcollection01';
          });
  
  /*********Graduation**************/
document.getElementById('graduation20-01-section').addEventListener("click",         function(event) {
    
      window.location.href =     'https://www.jmarz.art/graduation20-01/';
          });

  
      /*********Pink Skirt**************/
document.getElementById('pinkskirt01-section').addEventListener("click",         function(event) {
    
      window.location.href =     'https://www.jmarz.art/pinkskirt01';
          });

  
        /*********Fourth Of July**************/
document.getElementById('4thofjuly20-01-section').addEventListener("click",         function(event) {
    
      window.location.href =     'https://www.jmarz.art/4thofjuly20-01';
          });
};

</script>

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...