!DOCTYPE html

創(chuàng)新互聯(lián)建站2013年開(kāi)創(chuàng)至今,先為鎮(zhèn)江等服務(wù)建站,鎮(zhèn)江等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢(xún)服務(wù)。為鎮(zhèn)江企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。
html
head
title黑客帝國(guó)效果/title
/head
body
canvas id="canvas"/canvas
style type="text/css"
body{margin: 0;
padding: 0;
overflow: hidden;}
/style
script type="text/javascript"
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
canvas.height = window.innerHeight;
canvas.width = window.innerWidth;
var texts = '0123456789'.split('');
var fontSize = 16;
var columns = canvas.width/fontSize;// 用于計(jì)算輸出文字時(shí)坐標(biāo),所以長(zhǎng)度即為列數(shù)
var drops = [];//初始值
for(var x = 0; x columns; x++){
drops[x] = 1;
}
function draw(){
//讓背景逐漸由透明到不透明
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);//文字顏色
ctx.fillStyle = '#0F0';
ctx.font = fontSize + 'px arial';//逐行輸出文字
for(var i = 0; i drops.length; i++){
var text = texts[Math.floor(Math.random()*texts.length)];
ctx.fillText(text, i*fontSize, drops[i]*fontSize);
if(drops[i]*fontSize canvas.height || Math.random() 0.95){
drops[i] = 0;
}
drops[i]++;}}
setInterval(draw, 33);
/script
/body
一、web應(yīng)用更容易開(kāi)發(fā)
HTML5的規(guī)范都是基于用戶(hù)優(yōu)先準(zhǔn)則來(lái)編寫(xiě)的,貼合開(kāi)發(fā)者的編碼習(xí)慣,語(yǔ)法限制不嚴(yán),代碼也更為精簡(jiǎn),更易于閱讀。
二、功能強(qiáng)大,用戶(hù)體驗(yàn)佳
HTML5視頻播放起來(lái)更流暢清晰,也更省電;HTML5游戲小巧流暢,畫(huà)面質(zhì)量高,操作易上手;HTML5廣告擺脫了以前網(wǎng)頁(yè)廣告的懸浮、滾動(dòng)和彈出,廣告更容易讓用戶(hù)接受。
三、搜索引擎友好,網(wǎng)站流量大
HTML5的代碼是貼合用戶(hù)有明確釋義的,不僅對(duì)開(kāi)發(fā)者有利,搜索引擎也更容易識(shí)別到網(wǎng)頁(yè)上的內(nèi)容,讓網(wǎng)站獲得更多流量。
四、擺脫平臺(tái)依賴(lài),兼容性好
對(duì)開(kāi)發(fā)者來(lái)說(shuō),HTML5可以做到跨平臺(tái),多數(shù)核心代碼不用重寫(xiě),能應(yīng)用于包括移動(dòng)應(yīng)用、移動(dòng)網(wǎng)站、PC網(wǎng)站、各種瀏覽器插件。對(duì)用戶(hù)來(lái)說(shuō),不用下載APP,直接打開(kāi)瀏覽器就能訪問(wèn)你的應(yīng)用,避開(kāi)了了各類(lèi)應(yīng)用商店的審核程序。
五、實(shí)時(shí)更新,維護(hù)更簡(jiǎn)單
游戲客戶(hù)端每次都要更新,很麻煩。可是更新HTML5游戲就好像更新頁(yè)面一樣,是馬上的、即時(shí)的更新。
六、使用門(mén)檻低,容易推廣
HTML5 應(yīng)用導(dǎo)流入口很多,超級(jí) App (如微信朋友圈)、搜索引擎、應(yīng)用市場(chǎng)、瀏覽器……而原生 App 的流量入口只有應(yīng)用市場(chǎng)。一些風(fēng)靡朋友圈的小游戲,無(wú)需下載,點(diǎn)開(kāi)就玩,如果換成APP,推廣效果就沒(méi)那么好了。
七、更精美的動(dòng)畫(huà)效果,更低的開(kāi)發(fā)成本
應(yīng)用HTML5技術(shù)做出來(lái)的網(wǎng)頁(yè)能給人眼前一亮的感覺(jué),這些動(dòng)畫(huà)是基于html5標(biāo)簽和CSS3樣式共同實(shí)現(xiàn)的效果,HTML5技術(shù)還支持自適應(yīng),能做到“一次設(shè)計(jì),普遍適用。”不用單獨(dú)開(kāi)發(fā)手機(jī)網(wǎng)站,為企業(yè)降低了開(kāi)發(fā)成本。
是自動(dòng)彈出書(shū)角頁(yè)的意思。
大部分的H5工具其實(shí)都可以做到,使用意派Epub360。點(diǎn)擊圖片直接就可以跳下一頁(yè)。
“符合HTML5標(biāo)準(zhǔn)實(shí)現(xiàn)的頁(yè)面就是H5頁(yè)面”,那當(dāng)前互聯(lián)網(wǎng)上看到的網(wǎng)站基本上都在采用了HTML5標(biāo)準(zhǔn)。
touchMove 要結(jié)合使用touchstar,touchend進(jìn)行判斷的。
沒(méi)有做過(guò)類(lèi)似的東西,但是下面的是仿微信圖片瀏覽的代碼,寫(xiě)了注釋?zhuān)M麑?duì)你有點(diǎn)幫助!
script
function imgreset(){
$(this).css3Animate({
width: imgoldw+"px",
//x:0,
//y:0,
time: "0ms",
callback: function () {
pagex1_s=null;pagey1_s=null;pagex2_s=null;pagey2_s=null;pagex1_e=null;pagey1_e=null;
pagex2_e=null;pagey2_e=null;pagexm1_s=null;pageym1_s=null;pagexm1_e=null;pageym1_e=null;
dm=0;dn=0;
imgneww=imgoldw
}
});
}
var imgoldw=320;//獲取圖片寛度
var imglength=$(".imgbox").length;//獲取圖片個(gè)數(shù)
var demos = document.getElementById("container"),
spirit, startScale, startRotation;
var dm=0,dn=0,imgneww=imgoldw,ismove=false,pic_c=0;
var body_w=$("body").width();
var body_h=$("body").height();
var pagex1_s,pagey1_s,pagex2_s,pagey2_s,pagex1_e,pagey1_e,pagex2_e,pagey2_e,pagexm1_s,pageym1_s,pagexm1_e,pageym1_e;
function touchStart(e) {
//e.stopPropagation();
e.preventDefault();
if(e.touches.length == 1){
ismove=true;
var touch1 = e.touches[0];
pagexm1_s = touch1.pageX;
pageym1_s = touch1.pageY;
}
if (e.touches.length == 2){
var touch1 = e.touches[0];
pagex1_s = touch1.pageX;
pagey1_s = touch1.pageY;
var touch2 = e.touches[1];
pagex2_s = touch2.pageX;
pagey2_s = touch2.pageY;
left = Math.min(pagex1_s, pagex2_s),
top = Math.min(pagey1_s, pagey2_s),
width = Math.abs(pagex1_s - pagex2_s),
height = Math.abs(pagey1_s - pagey2_s);
}
}
function touchMove(e){
//e.stopPropagation();
e.preventDefault();
if (ismovee.touches.length == 1){
//單點(diǎn)觸摸
var touch1 = e.touches[0],
pagexm1_e = touch1.pageX,
pageym1_e = touch1.pageY,
//移動(dòng)了多少
dx=pagexm1_e-pagexm1_s,
dy=pageym1_e-pageym1_s;
//是多少
dm=dx+dm;
dn=dy+dn;
if(imgneww==imgoldw){
$(this).css3Animate({
x:dm,
//y:dn,
time: "0ms",
callback: function () {
}
});
//如果圖未放大,則執(zhí)行翻頁(yè)
}else{
//如果圖片已經(jīng)被放大,則可以拖動(dòng)
$(this).css3Animate({
x:dm,
y:dn,
time: "0ms",
callback: function () {
//記錄新位置
}
});
}
pagexm1_s=pagexm1_e,pageym1_s=pageym1_e;
}
if (e.touches.length == 2){
//多點(diǎn)觸摸
var touch1 = e.touches[0];
pagex1_e = touch1.pageX;
pagey1_e = touch1.pageY;
var touch2 = e.touches[1];
pagex2_e = touch2.pageX;
pagey2_e = touch2.pageY;
//計(jì)算兩點(diǎn)開(kāi)始距離 old
var oldx=Math.abs(pagex1_s-pagex2_s),
oldy=Math.abs(pagey1_s-pagey2_s),
//計(jì)算兩點(diǎn)開(kāi)始距離 new
newx=Math.abs(pagex1_e-pagex2_e),
newy=Math.abs(pagey1_e-pagey2_e);
if(oldxnewxoldynewy){
var imgw=$(this).width();//獲取圖片寛度
resizex=oldx-newx;//縮小多少
var resizey=oldy-newy;//縮小多少
if(imgwimgoldw){
$(this).css3Animate({
width: imgneww-resizex+"px",
x:dm,
y:dn,
time: "0ms",
callback: function () {
}
});
imgneww=imgneww-resizex;
};
}else{
var imgw=$(this).width();//獲取圖片寛度
var resizex=Math.abs(oldx-newx);
var resizey=Math.abs(oldy-newy);//縮小多少
if(imgw640){
$(this).css3Animate({
width: imgneww+resizex+"px",
x:dm,
y:dn,
time: "0ms",
callback: function () {
}
});
imgneww=imgneww+resizex;
}
}
}
pagex1_s=pagex1_e,pagey1_s=pagey1_e,pagex2_s=pagex2_e,pagey2_s=pagey2_e;
}
function touchEnd(e) {
e.preventDefault();
var imglength=$(".imgbox").length;
var id=parseInt($(this).attr("id").substr(9));
if(ismoveimgneww==imgoldwdm0Math.abs(dm)body_w/2id!=imglength-1){
$.ui.loadDiv('#my_photos_'+(id+1),false,false,'flip');
$(this).css3Animate({
x:0,
time: "0ms",
callback: function () {
dm=0;
}
});
}else if(ismoveimgneww==imgoldwdm0Math.abs(dm)body_w/2id!=0){
$.ui.loadDiv('#my_photos_'+(id-1),false,false,'flip');
$(this).css3Animate({
x:0,
time: "0ms",
callback: function () {
dm=0;
}
});
}else{
if(ismoveimgneww==imgoldw){
$(this).css3Animate({
x:0,
time: "0ms",
callback: function () {
dm=0;
}
});
}
}
ismove=false;
}
function gestureEnd(e) {
e.preventDefault();
if (!spirit) return;
canvas.removeChild(spirit);
spirit = null;
startScale = null;
startRotation = null;
}
/* $(".imgbox img").bind("touchstart", touchStart, false);
$(".imgbox img").bind("touchmove", touchMove, false);
$(".imgbox img").bind("touchend", touchEnd, false);
$(".imgbox img").bind("gestureend", gestureEnd, false);
$(".imgbox img").bind("tap", imgreset, false);
*/
/script
初學(xué)者應(yīng)該做一個(gè)一個(gè)模塊,實(shí)現(xiàn)各種新功能,把這些做好了再想網(wǎng)頁(yè)的布局吧。不可急功近利。
想做簡(jiǎn)單的你可以照著百科上的頁(yè)面做,別管廣告之類(lèi)的功能,就是單純努力去實(shí)現(xiàn)百科上的各種內(nèi)容排版。
復(fù)雜的可以找些購(gòu)物網(wǎng)站的主頁(yè)做
網(wǎng)站名稱(chēng):html5仿,html5仿微信app個(gè)人中心頁(yè)面
標(biāo)題來(lái)源:http://chinadenli.net/article13/dsihjds.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、搜索引擎優(yōu)化、服務(wù)器托管、靜態(tài)網(wǎng)站、網(wǎng)站導(dǎo)航、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容