1

I am using FancyBox to show some images. I have to pass the image ID to the base URL to get the image so in both 'anchor' tag and 'img' tag, I am using the same URL to get the image.

This is my HTML code:

<a ng-repeat="id in voilation.PhotoIds" class="voilations-image-list fancybox" rel="gallery1" href="baseURL/{{id}}"><img ng-src="baseURL/{{id}}" class="img-thumbnail" /></a>

The JS:

$(".fancybox").fancybox({
    openEffect: 'none',
       closeEffect: 'none'
});

I am retrieving the ID through Angular Js and Merging it in the baseURL. But the fancybox doesn't work and the image opens in new tab.

Thanks

  • did you init the fancyboxes with js before...^^ ? just add "fancybox" class to an item is not enough... maybe first have a look at this : http://stackoverflow.com/questions/13868132/fancybox-iframe-doesnt-work – Julo0sS Sep 01 '15 at 08:27
  • Ofcourse i did that. I followed the documentation. – Talal Tahir Malik Sep 01 '15 at 08:30
  • So why do you post only a small part of your "fancybox code" (Where is the Js?) then?? oO – Julo0sS Sep 01 '15 at 08:31
  • Because JS in fine and i know that. But there you go, i have added the JS. – Talal Tahir Malik Sep 01 '15 at 08:44
  • here is an "almost" copy paste example from the fancybox website examples, this is the same url on link and on image, and it works... http://jsfiddle.net/2k8EP/1768/ – Julo0sS Sep 01 '15 at 08:54
  • this should solve your problem : http://jsfiddle.net/2k8EP/1771/ – Julo0sS Sep 01 '15 at 08:57
  • Can you show the rendered HTML? My guess? you have this issue http://stackoverflow.com/q/17554068/1055987 – JFK Sep 02 '15 at 02:46

0 Answers0