I've tried a couple of ways to do this and have found issues with both.
- Loading the image from a ajax post, and updating an img id source to it.
- PHP function that loads all images in a "li" list with a class set to display:none and with jquery hide/show the image.
My problem is that these images are 1440px x 960px minimum. So if I load with ajax post it takes a while to show the full image, and if I load with php loop it takes a veryyyy long time for the page to load.
Here is my example of my php loop function:
public function LoadStreamImages()
{
$imgs = '<li id="0"><img src="img/OM.jpg" class="bgimg" /></li>';
if($db->num_rows($consulta)>0)
{
while($row = $db->fetch_array($consulta)) {
$imgs .= '<li id="' . $row['id'] . '" class="hidden"><img src="img/' . $row['imagefile'] . '" class="bgimg" /></li>';
}
}
echo $imgs;
}
anything I can do to spead this up?