Jump to content

fancybox error - The requested content cannot be loaded Please Try Again Later


Recommended Posts

Hi there guys I have a problem that I can't seem to get fixed.

 

Below Is the code I am using and the Link to the Tutorial:

 

http://fearlessflyer.com/create-an-awesome-photo-gallery-with-fancybox-and-timthumb/

                        
<?php 
$path =  'http://' . $_SERVER['SERVER_NAME'] . 'moment/uploads/'; 
$files = scandir('uploads/'); 
?>
   
 
<ul>
<?php foreach ($files as $file){ 
if ($file == '.' || $file == '..'){ 
echo ''; 
} else {
?>
<li ><a href="<?php echo $path . $file; ?>" rel="lightbox"><img src="timthumb.php?src=<?php echo $path . $file; ?>&h=194&w=224&zc=1&q=100" /></a></li>
<?php } }?>
</ul>          
 
 

 

  <!-- FANCYBOX -->      
  <script type='text/javascript' src='assets/js/jquery.fancybox.js'></script>
   <script type='text/javascript' src='assets/js/jquery.mousewheel-3.0.6.pack.js'></script>
  <link rel='stylesheet' href='assets/css/jquery.fancybox.css' />
  
<script>
$(document).ready(function(){
$("a[rel=lightbox]").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
});
 
</script>
 
 
 
My pictures and everything is working but when I click on the image to open up in a lightbox it gives me an error: The Requested Content Cannot Be Loaded, Please Try Again Later.
 
In the attached is a image of the error

post-168943-0-52890900-1412447549_thumb.png

Should these

<li ><a href="<?php echo $path . $file; ?>" rel="lightbox"><img src="timthumb.php?src=<?php echo $path . $file; ?>&h=194&w=224&zc=1&q=100" /></a></li>
links not point to the same source?

 

You want the link to an actual file, but you are generating the thumb. While that is theoretically correct, are you sure that you are pointing the link at the correct source?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.