0

I have a fancybox to load every time that I load a page. But when the fancybox open give me this error:

The requested content cannot be loaded. Please try again later.

This is my code:

<script type="text/javascript">
    $(document).ready(function() {
        $("#inline1").fancybox().trigger('click');
    });
</script>

<div id="inline1" style="display:none;">
    <p>
    Some text
    </p>
</div>
Alessandro Minoccheri
  • 35,521
  • 22
  • 122
  • 171
  • MAy Be this old question can help you http://stackoverflow.com/questions/8913583/fancybox-returning-the-requested-content-cannot-be-loaded-please-try-again-lat http://stackoverflow.com/questions/4941002/fancybox-returning-the-requested-content-cannot-be-loaded-please-try-again-la http://stackoverflow.com/questions/10857849/fancybox-the-requested-content-cannot-be-loaded-please-try-again-later – CRDave Sep 14 '12 at 10:10

1 Answers1

1

If you are using fancybox v1.3.4 (most likely) then you need to wrap your inline content in a hidden div; in other words, the inline (targeted) content shouldn't have the property display: none but the parent wrapper.

So the correct structure should be

<div style="display:none;">
  <div id="inline1">
    <p> Some text </p>
  </div>
</div>
JFK
  • 40,963
  • 31
  • 133
  • 306