adaptive images是一个php编写的工具,它可将图像传输到小型移动设备上。应用嵌入式解决方案会根据设备屏幕大小 自动创建、捕捉、传输图片,而不需要额外改动图像。
一、在图片文件夹创建.htaccess文件
<IfModule mod_rewrite.c><br /> Options +FollowSymlinks<br /> RewriteEngine On<br /> # Adaptive-Images -----------------------------------------------------------------------------------<br /> # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:<br /> # RewriteCond %{REQUEST_URI} !ignore-this-directory<br /> # RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too<br /> RewriteCond %{REQUEST_URI} !assets<br /> # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories<br /> # to adaptive-images.php so we can select appropriately sized versions<br /> RewriteRule .(?:jpe?g|gif|png)$ adaptive-images.php<br /> # END Adaptive-Images -------------------------------------------------------------------------------<br /></IfModule>二、将如下JS脚本复制到每个需要自适应图片的网页的头部
<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>
三、HTML代码
LANUX V1.0 蓝脑商务网站系统 适用于网店、公司宣传自己的品牌和产品。 系统在代码、页面方面设计简约,浏览和后台管理操作效率高。 此版本带可见即可得的html编辑器, 方便直观添加和编辑要发布的内容。 安装: 1.解压后,更换logo、分类名称、幻灯片的图片及名称和链接、联系我们等等页面。 2.将dbconfig.php里面的数据库配置更改为你的mysql数据库配置 3.将整个文件夹上传至
0
test
<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>
Example in action
项目地址:http://adaptive-images.com/
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号