HTML5 Canvas標籤範例
隨著時代的進步,HTML的版本一直在進化,目前比較新的版本應該就是HTML5了,這次的HTML5針對許多標籤進行調整,當然也新增了一些標籤,主要的目的是希望可以將一些本來需要利用Flash才可以完成的互動頁面取而用HTML5來進行設計,這樣比較能減輕網頁的負載,但不管怎麼進步,其最重要的目的當然還是要網友能夠看到才行!
目前各家的瀏覽器對於HTML5的支援都不一,如果想要測試看看自己所使用的瀏覽器對HTML5的支援程度,可以到這個網址測試,馬老師針對目前的三款瀏覽器(IE9、Firefox6、Chrome13)來做了測試,IE9於HTML5中測試得到了以下的分數:
Firefox6於HTML5中測試得到了以下的分數:
Chrome13於HTML5中測試得到了以下的分數:
所以用以上的結果來看,目前是Google Chrome對於HTML5的支援最好,不過也只是拿了450分中的340而已,所以是否要全面改用HTML5來開發,還是應該要好好的斟酌一下,但是先了解HTML5能做到的功能,一定是沒問題的!以下就是馬老師針對HTML新增的畫布標籤製作的範例,不過因為瀏覽器支援的關係,必須使用Chrome觀賞才會是比較完整的功能喔!
範例影片:
PS:本範例的網頁所使用的圖檔為寬:800、高:600的圖檔,並將圖檔至於img的資料夾中
網頁程式碼:
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Slide Show</title> <script> var context; var x = 0; var ind; var offset; var photos = new Array(); for(var i=1;i<=13;i++){ var im = new Image(); im.src = "img/p" + i + ".jpg"; photos.push(im); } function slideshow(){ context = document.getElementById('canvas').getContext('2d'); setInterval(loop,10); } function loop(){ x += (slider.value - x) * 0.1; ind = Math.floor(x/800); offset = x % 800; context.drawImage(photos[ind], offset, 0, 800-offset, 600, 0, 0, 800-offset, 600); context.drawImage(photos[ind+1], 0, 0, 800, 600, 800-offset, 0, 800, 600); } </script> </head> <body onLoad="slideshow()"> <canvas width="800" height="600" id="canvas"></canvas><br /> <input type="range" id="slider" style="width:800px;" min="0" max="9600" step="1" value="0"> </body> </html>
Good blog you have here.. It’s difficult to find good quality writing like yours nowadays. I truly appreciate people like you! Take care!!
best place to buy generic cialis online: Generic Tadalafil 20mg price – generic cialis reviews
https://tadalafil.auction/# buy cialis cheap prices fast delivery
Привет, друзья!
Как купить аттестат 11 класса с официальным упрощенным обучением в Москве
mans-diplomxx.ru/svidetelstvo-o-rozhdenii-sssr1
Окажем помощь!.
Добрый день!
Мы изготавливаем дипломы психологов, юристов, экономистов и любых других профессий по разумным тарифам.
rushkadiplomik.ru/kupit-diplom-krasnodar
Great submit I’m serious to master just what internet site method that you are making use of? We have been encountering several modest stableness difficulties with my own newest web site and also I’d just like to discover anything at all far more protected. Any kind of solutions… In addition think about Egypt awesome details!
Excellent post. I was checking constantly this blog and I’m impressed! Very helpful information specially the last part I care for such information much. I was seeking this particular information for a long time. Thank you and best of luck.
female viagra: Buy Viagra online cheap – п»їover the counter viagra
Установка сплит системы Установка сплит системы .
My brother suggested I might like this web site. He was once totally right. This put up truly made my day. You cann’t consider just how much time I had spent for this info! Thanks!
Здравствуйте!
Как безопасно купить диплом колледжа или ПТУ в России, что важно знать
rushkadiplomik.ru
farmacie online affidabili: Avanafil a cosa serve – Farmacie on line spedizione gratuita
Стоимость установки кондиционера Липецке http://www.ustanovka-kondicionerov480.ru/ .
I used to be able to find good advice from your blog posts.
Hi! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job!
you use a fantastic blog here! do you wish to cook some invite posts in this little blog?
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back often!
Добрый день!
Полезные советы по безопасной покупке диплома о высшем образовании
landik-diploms-srednee.ru/kupit-diplom-v-omske
Attention ! I just found an error in your article! Check if your theme is set right!
http://cialisgenerico.life/# comprare farmaci online all’estero
farmacie online sicure: kamagra oral jelly – comprare farmaci online con ricetta
I love reading through a post that can make people think. Also, thanks for permitting me to comment.
farmacia online senza ricetta: Avanafil a cosa serve – Farmacie on line spedizione gratuita
viagra originale in 24 ore contrassegno: viagra farmacia – pillole per erezioni fortissime
You can certainly see your expertise in the work you write. The world hopes for even more passionate writers like you who aren’t afraid to say how they believe. At all times go after your heart.
I like this post, enjoyed this one regards for posting .
Whats up! I simply wish to give an enormous thumbs up for the great information you have here on this post. I might be coming again to your blog for more soon.
Привет, друзья!
Процесс получения диплома стоматолога: реально ли это сделать быстро?
rushkadiplomik.ru