在浏览有些网站时,发现图片是在下拉滚动条时才加载,这是一个很不错的用户体验。这一效果是通过JavaScript 编写的 jQuery 插件实现的,它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预加载的处理方式正好是相反的.在包含很多大图片长页面中延迟加载图片可以加快页面加载速度. 浏览器将会在加载可见图片之后即进入就绪状态. 在某些情况下还可以帮助降低服务器负担. 有些WordPress主题也具备了此功能。
Author Archive
jQuery实现图片延迟加载
TS重写MENU逻辑
1{
expAll = 1 #sub menu all show
wrap = - |
php生成随机字符串
function generate_code(){
$code = "";
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$code = $code . $tmp;
$i++;
}
return $code;
}
六个好用的MySQL的SQL语句
1. 计算年数
你想通过生日来计算这个人有几岁了。
New mail API for the core
TYPO3 4.5 comes with the Swift Mailer library as the new mail API. It’s quite easy to use it in extensions. (continue reading…)
htaccess redirect only for MSIE 5 and 6 and winxp
RewriteEngine on
#
# Redirect IE 5 and IE 6 requests to version-specific subdomains
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\. [OR]
RewriteCond %{HTTP_USER_AGENT} Windows\ NT\ 5\.1
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=302,L]
.htaccess RewriteRule详解
1、Rewrite规则简介:
Rewirte 主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言。可基于服务器级的(httpd.conf)和目录级的(.htaccess)两种方 式。如果要想用到rewrite模块,必须先安装或加载rewrite模块。方法有两种一种是编译apache的时候就直接安装rewrite模块,别一 种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块。 (continue reading…)
Apache SSL in htaccess examples
Apache SSL examples in htaccess files
Any htaccess rewrite examples should always begin with
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
Fixing double-login problem and making sure authorization usernames/passwords are not sent in cleartext unencrypted. (continue reading…)
Htaccess文件用法集锦
1.时区设置
有些时候,当你在PHP里使用date或mktime函数时,由于时区的不同,它会显示出一些很奇怪的信息。下面是解决这个问题的方法之一。就是设置你的服务器的时区。你可以在这里找到所有支持的时区的清单。 (continue reading…)