Note that there are some explanatory texts on larger screens.

plurals
  1. POis it possible to preload links tht a dynamically loaded to a page?
    text
    copied!<p>Is it possible to preload images from a link. a thumbnail gallery in which the the thumbnails are linked to their respective large images using php. is it possible to use a jquery code to preload the large images even though they are just links?</p> <pre><code>&lt;?php error_reporting(0); /* function: returns files from dir */ function get_files($images_dir,$exts = array('jpeg','gif','png','jpg')) { $files = array(); if($handle = opendir($images_dir)) { while(false !== ($file = readdir($handle))) { $extension = strtolower(get_file_extension($file)); if($extension &amp;&amp; in_array($extension,$exts)) { $files[] = $file; } } closedir($handle); } return $files; } /* function: returns a file's extension */ function get_file_extension($file_name) { return substr(strrchr($file_name,'.'),1); } $images_dir = 'hftpnyc/thumbs/'; $thumbs_dir = 'hftpnyc/thumbs/thumbnails/'; $thumbs_width = 100; $images_per_row = 11; $string = ""; /** generate photo gallery **/ $image_files = get_files($images_dir); if(count($image_files)) { $index = 0; foreach($image_files as $index=&gt;$file) { $index++; $thumbnail_image = $thumbs_dir.$file; //if(!file_exists($thumbnail_image)) { //$extension = get_file_extension($thumbnail_image); //if($extension) { //make_thumb($images_dir.$file,$thumbnail_image,$thumbs_width); //} //} error_reporting(0); echo '&lt;div class="smllpic" style=" padding: 0px; margin: 0px; border: 1px solid black; display: block; width: 100px; height:100px; float: left; "&gt;&lt;a href="'.$images_dir.$file.'" rel="lrgimg" class="lightbox"&gt; &lt;img id="thumbs" src="',$thumbnail_image,'" width="100px"/&gt;&lt;/a&gt;&lt;/div&gt;'; if($index % $images_per_row == 0) { echo '&lt;div class="clear"&gt;&lt;/div&gt;'; } } } else { echo '&lt;p&gt;There are no images in this gallery.&lt;/p&gt;'; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload