title: Javascript link to LIGHTBOX images
body: <p>I want add images to my lightbox gallery using javascript links. 
  for example, I tried,</p>
  
  <pre><code>&lt;script&gt;
  imageArray =[
  "image1.jpg",
  "image2.jpg",
  "image3.jpg"
  ];
  
  function assignUrl(img_num)
      {
          return "www.website/images/" + imageArray[img_num];
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And in my gallery, I used,</p>
  
  <pre><code>&lt;a href="javascript:document.location.href=assignUrl(0);"  
  data-lightbox="imagegallery" &gt;
  &lt;img src="javascript:document.location.href=assignUrl(0);" &lt;!-- thumbnail--&gt;        
  &lt;/a&gt;
  </code></pre>
  
  <p>But it doesn't work.. The thumbnail doesn't show, and when u click, the image keeps loading but nothing happens.</p>
  
  <p>When I use a test link like this, It displays the image.</p>
  
  <pre><code>&lt;a href="javascript:document.location.href=assignUrl(0);"&gt; TEST &lt;/a&gt;
  </code></pre>
  
  <p>Please help? what am I doing wrong? Is there any other workaround this?</p>