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>
There is a lot of fear, risk, and ambiguity around starting out as a freelancer, but if you can stomach all that, it will prove gratifying.
My partner and i still can not quite think that I could often be one of those reading through the important suggestions found on your site. My family and I are truly thankful for the generosity and for giving me the advantage pursue this chosen profession path. Thanks for the important information I managed to get from your site.
I went over this site and I believe you have a lot of fantastic information, saved to favorites (:.
Привет!
Заказать документ ВУЗа вы можете в нашей компании в Москве.
ast-diplomas.com/kupit-diplom-chelyabinsk
I discovered your blog website on google and examine a number of of your early posts. Proceed to maintain up the very good operate. I simply further up your RSS feed to my MSN Information Reader. Looking for forward to studying extra from you in a while!? I’m usually to running a blog and i actually respect your content. The article has really peaks my interest. I am going to bookmark your site and hold checking for brand new information.
Здравствуйте!
Мы изготавливаем дипломы любой профессии по приятным ценам.
poperechny.net/analiz-proizvedenii/kupriyanova-tekst-i-prostranstvo-v-skazkakh-o-uaylda-solovey-i-roza
And many gun enthusiasts and sportsmen swear by their Glocks, which come in several variants to accommodate different types of ammunition.
Autonomo в Испании klaipedatours.ru .
there are many new movies to watch this month, i would be going to the cinema and video rental store again**
tamoxifen and ovarian cancer: tamoxifen for men – tamoxifen depression
Thanks for this grand post, I am glad I found this site on yahoo.
I’m impressed, I have to admit. Truly rarely should i encounter a blog that’s both educative and entertaining, and let me tell you, you’ve got hit the nail to the head. Your thought is outstanding; ab muscles a thing that too little people are speaking intelligently about. We are very happy that I came across this at my try to find some thing about it.
Pretty! This has been a really wonderful article. Thank you for providing this information.
Привет!
Покупка диплома о среднем полном образовании: как избежать мошенничества?
mans-diplomy.ru
Добрый день!
Мы изготавливаем дипломы любой профессии по приятным тарифам.
pro-eltern.de/read-blog/145_hotite-zakazat-attestat-u-nadezhnogo-proizvoditelya-zhdem-vas
Добрый день!
Мы предлагаем дипломы любой профессии.
networldinternational.com/2024/07/12/диплом-дизайнера-куплю
Рады оказаться полезными!.
Привет, друзья!
Заказать документ о получении высшего образования можно в нашем сервисе.
diplomasx.com/kupit-diplom-chelyabinsk
” The crew includes old chipper Morgan Freeman as Joe, paranoid John Malkovich as Boggs, and the glamorous “goddess,” Helen Mirren.
I am curious to find out what blog platform you’re using? I’m experiencing some minor security problems with my latest blog and I would like to find something more safe. Do you have any solutions?
Definitely believe that that you said. Your favourite reason appeared to be at the internet the easiest thing to consider of. I say to you, I definitely get annoyed whilst other folks think about concerns that they just don’t understand about. You managed to hit the nail upon the top well outlined out the whole thing without having side-effects , folks can take a signal. Will likely be again to get more. Thank you
разработка сайтов разработка сайтов .
Привет, друзья!
Приобрести документ университета
arusak-diploms-srednee.ru/kupit-attestat-za-11-klass
Здравствуйте!
Диплом специалиста
weekofsport.ru/oformite-diplom-bez-ozhidaniya
i would love to use hydrogen fuel on my car, this fuel is really nonpolluting but is not yet very available::
When I originally commented I clicked the -Notify me when new comments are added- checkbox and today when a comment is added I am four emails with the exact same comment. Could there be by any means it is possible to get rid of me from that service? Thanks!
whoah this blog is magnificent i love reading your posts. Keep up the great work! You know, lots of people are looking around for this info, you could help them greatly.
This website does not display properly on my apple iphone – you might want to try and fix that
One other issue is that if you are in a problem where you will not have a co-signer then you may want to try to exhaust all of your financing options. You can find many funds and other scholarships that will offer you funding that can help with college expenses. Thank you for the post.
Добрый день!
Купить документ о получении высшего образования можно в нашей компании.
ast-diplomy.com/kupit-diplom-novosibirsk
Здравствуйте!
Как получить диплом техникума официально и без лишних проблем
mans-diplomas.ru