Category: WEB
原文复制三边,用animate跑,每次跑1/3,然后用css(‘left’,reset) 移动位置,其他就不多解释了。
var scroller = $(‘#rtext’),html = scroller.html(),scrollInterval = -1,scrollTime = 30000,reset = 0;
scroller.html( html + html + html);
scrollInterval = window.setInterval(function(){
scroll(true);
},scrollTime/4);function scroll(){
scroller.css({‘left’:reset}).stop().animate({‘left’:"-="+scroller.width()/3},scrollTime/3,’linear’);
}scroller.css(‘width’,'auto’).hover(function(){
$(‘#rtext’).stop();
scrollInterval = window.clearInterval(scrollInterval);
},function(){
scrollInterval = window.clearInterval(scrollInterval);
scrollInterval = window.setInterval(function(){
scroll();
},scrollTime/3);
scroller.stop().animate({‘left’:"-="+scroller.width()/3},scrollTime/3,’linear’);
if(parseInt(scroller.css(‘left’)) < – scroller.width()/3){
reset = parseInt(scroller.css(‘left’)) + scroller.width()/3;
}else{
reset = parseInt(scroller.css(‘left’));
}
});
scroll();
解决方法是就是延时100ms 如果100ms内进入下一个触发区就不显示了。
$(‘.tab li’).mouseenter(function(e){
timeout = window.clearTimeout(timeout);
timeout = window.setTimeout(function(){
//鼠标进入热点区要执行的代码
/*…*/
//———————-
},100);
);
<base id="headbase" href="http://bbs.yahoo.cn/" />
原标题:Build Web applications with HTML 5
原链接:http://www.ibm.com/developerworks/web/library/wa-html5webapp/?ca=dgr-lnxw07HTML5-Appsdth-WD
大家自己去看,不做全文翻译,不清楚的可以提出来交流
相关功能
1.多线程
2.数据库
3.视频
4.H264支持
5.OGG支持
6.GEO信息
浏览器支持情况
#Firefox 3.6
Your browser’s user-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Web Workers? true
Database? false
Video? true
Can play H.264? no
Can play OGG? probably
Geolocation? true
Latitude: 37.2502812
Longitude: -121.9059866
#Safari 4.0.4 Your browser’s user-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10
Web Workers? true
Database? true
Video? true
Can play H.264? probably
Can play OGG? no
Geolocation? false
#Chrome 5.0.322 Your browser’s user-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Chrome/5.0.322.2 Safari/533.1
Web Workers? true
Database? true
Video? true
Can play H.264? no
Can play OGG? no
Geolocation? false
移动浏览器支持情况
#iPhone 3.1.3 Simulator
Your browser’s user-agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3.1.3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16
Web Workers? false
Database? true
Video? true
Can play H.264? maybe
Can play OGG? no
Geolocation? true
Latitude: 37.331689
Longitude: -122.030731
#Android 1.6 Emulator
Your browser’s user-agent: Mozilla/5.0 (Linux; Android 1.6; en-us; sdk Build/Donut) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
Web Workers? false
Database? false
Video? false
Geolocation? false
#Android 2.1 Emulator
Your browser’s user-agent: Mozilla/5.0 (Linux; U; Android 2.1; en-us; sdk Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Web Workers? true
Database? true
Video? true
Can play H.264? no
Can play OGG? no
Geolocation? true
Latitude:
Longitude:
注意:请参考详细版本号,当时不支持不代表现在不支持
原文中还有使用HTML5数据库和多线程的例子,详细代码请移步IBM网页查询。
官方首页
http://wiki.github.com/sorccu/cufon/about
演示页
http://wiki.github.com/sorccu/cufon/demos
使用方法
http://wiki.github.com/sorccu/cufon/usage
字体生成
http://cufon.shoqolate.com/generate/
注意:cufon用中文的话体积不小,库文件是7.3k,字体文件大概是1个字1k左右(有人说),
所以大家可以根据需要在图片和cufon之间自行取舍。
最后再盗用一个官方的原理图
178的插件很霸道啊
