Use fancybox rel=“group” more than one time in same page its not working properly

Use fancybox rel=“group” more than one time in same page its not working properly


I have a list of articles and each article have a link "See full article".

When user clicks in this link it will open a fancybox with all article content.

And I want to navigate between news so Im using "rel="group" in my link, and it is working fine If I just have one rel="group". 

But I have two design versions one for desktop and one for mobile, and Im couting my chars differently depending on wich version is. And in each version Im using "rel=group", so I use "rel=group" two times, because I want to navigate between my news also in mobile.

But using "rel=group" two times its not working correctly, when I click in my arrow to change for next news I get again my current news and when I click again i get the same result, onlt at third click I get my next news inside fancybox.

Do you know why this can be happening?

  1. echo '<article class="news">';
  2.     echo '<p class="desktop">'.lmt_words($result['content'],370).'<a  id="'.$result['id_news'].'" class="fancybox" href="#window_fancybox'.$result['id_news'].'" rel="group">
  3.     See full article</a>
  4.     </p>';
  5.     echo '<p class="mobile">'.lmt_words($result['content'],170).'<a  id="'.$result['id_news'].'" class="fancybox" href="#window_fancybox'.$result['id_news'].'" rel="group">
  6.     See full article</a>
  7.     </p>';
  8.     echo '<div id="window_fancybox-container" class="modal_container">';
  9.         echo '<div id="window_fancybox'.$result['id_news'].'" class="modal" >';
  10.             //inside here I show all my article content
  11.         echo '</div>';
  12.     echo '</div>';
  13. echo '</article>';