javascript - How to implement this image preloader into my php file? -
i want have images processed via ajax preloaded visually rather usual loading of images see them build top bottom. please take here. see there want have in php file visually.
the part pictures loaded database following:
$sql = "select * `fabric`".$filter; $result=mysql_query("$sql"); //echo $sql; $data = ""; $ii = 0; $m = 0; while($myrow = mysql_fetch_array($result)){ $ii++; $m++; if ($m == 1) $data = $data."<div class=\"page current\">"; elseif ($ii == 1) $data = $data."<div class=\"page\">"; $data = $data."<a href=\"#\" title=\"".$myrow['name']."\" class=\"show_fabric\" rel=\"".$myrow['id']."\"><img src=\"".$image_directory.$myrow['thumbnail']."\" width=\"100 px\" height=\"100 px\"><div class=\"fb_name\">".$myrow['name']."</div></a>\n"; if ($ii == 10) { $data = $data."</div>"; $ii = 0; } } if ($ii != 10) { $data = $data."</div>"; } if (empty($data)) echo "no result"; else echo $data; ?>
i don't know how change php in order have effect shown in demo. thank constructive advices , forgive noobiness :)
you need javascript this, can´t in php alone. basic idea hide images using example visibility: hidden
, have them fade in when loaded. , @ load-time position loading image on top remove when start fading in image.
as example you've given, plugin, perhaps can use 1 instead of writing yourself.
Comments
Post a Comment