在滚动或单击按钮时加载更多图像(没有 mysql)
我有这个 php 代码,可以自动拇指并将我的照片排列到画廊:
<?php
$folder = "../albums/1000/";
$folder3 = "albums/1000/";
$handle = opendir($folder);
$noeffect = "noeffect";
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.png',1)||strpos($file, '.jpg',1)||strpos($file, '.JPG',1) ) {
$imgsrc= "../thumbnail.php?file=";
$imgend= "&width=120&height=120";
echo ("
<li><a href=\"".$folder.$file."\" rel=\"".$rel.external."\" class=\"".$noeffect."\">
<img src=\"".$imgsrc.$folder3.$file.$imgend."\" /></a></li> "); }}
?>
它效果很好,我喜欢它!但是当我上传 200-300 张图片时,它需要加载拇指才能查看图库中的大图片。 我在网上搜索并尝试了很多东西,但大多数都使用mysql,我不知道如何处理它,其他的则有问题..有什么解决方案吗?谢谢!
您可以在这里查看我在做什么: http://m.eladhamemagnet.net/ albums/996.php
顺便说一句,它适用于 iphone,所以这就是为什么我需要它快速加载
i have this php code who auto thumb and arrange my photos to gallery:
<?php
$folder = "../albums/1000/";
$folder3 = "albums/1000/";
$handle = opendir($folder);
$noeffect = "noeffect";
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.png',1)||strpos($file, '.jpg',1)||strpos($file, '.JPG',1) ) {
$imgsrc= "../thumbnail.php?file=";
$imgend= "&width=120&height=120";
echo ("
<li><a href=\"".$folder.$file."\" rel=\"".$rel.external."\" class=\"".$noeffect."\">
<img src=\"".$imgsrc.$folder3.$file.$imgend."\" /></a></li> "); }}
?>
it works great and i love it! but when i upload 200-300 pictures it need to load the thumbs before it could view the big picture in the gallery..
i search the net and tried many things but most of them use mysql and i dont know how to deal it and others were problematic.. any solution? thanks!
You can take a look here for example for what im doing : http://m.eladhamemagnet.net/albums/996.php
btw its for iphone so thats why i need it to load fast
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案..我确实预加载了任何照片..所以当加载缩略图时也会加载大图片..
I found the answer.. i did preload for any photo.. so when the thumbnail is loaded also the big picture..