Après avoir suivi, vous pouvez suivre ses informations dynamiques en temps opportun
Cours dans la section correspondante:Type d'opérateur du didacticiel de base Javascript
<script type="text/javascript"> var box; document.write(typeof box); </script>
2016-11-250個贊
Cours dans la section correspondante:La toile dessine du texte
<script type="text/javascript"> //通過id獲得當(dāng)前的Canvas對象 var canvasDom = document.getElementById("demoCanvas"); //通過Canvas Dom對象獲取Context的對象 var context = canvasDom.getContext("2d"); context.moveTo(200,200); // 設(shè)置字體 context.font = "Bold 50px Arial"; // 設(shè)置對齊方式 context.textAlign = "left"; // 設(shè)置填充顏色 context.fillStyle = "#005600"; // 設(shè)置字體內(nèi)容,以及在畫布上的位置 context.fillText("PHP中文網(wǎng)!", 10, 50); // 繪制空心字 context.strokeText("ipnx.cn!", 10, 100); </script>
2016-11-250個贊
Cours dans la section correspondante:La toile dessine des cercles et des ellipses
Context上下文的arc方法就是繪制圓形或者橢圓,arc方法的x和y參數(shù)是圓心坐標,radius是半徑,startAngle和endAngle則是扇形的起始角度和終止角度(以弧度表示),anticlockwise表示做圖時應(yīng)該逆時針畫(true)還是順時針畫(false)。
2016-11-250個贊
Cours dans la section correspondante:La toile dessine des images
<script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var img=document.getElementById("scream"); img.onload = function() { ctx.drawImage(img,10,10); } </script>
2016-11-250個贊
Cours dans la section correspondante:HTML5 utilise l'élément Vidéo
<video> 元素提供了 播放、暫停和音量控件來控制視頻。
2016-11-250個贊
Cours dans la section correspondante:Audio HTML5 (audio)
<audio src="song.ogg" controls="controls"> Your browser does not support the audio tag. </audio>
2016-11-250個贊
Cours dans la section correspondante:Fonctions du tutoriel de base Javascript
函數(shù)是完成某個特定功能的一組語句。如沒有函數(shù),完成任務(wù)可能需要五行、十行、甚至更多的代碼。這時我們就可以把完成特定功能的代碼塊放到一個函數(shù)里,直接調(diào)用這個函數(shù),就省重復(fù)輸入大量代碼的麻煩。 function 函數(shù)名(){ 函數(shù)代碼段; }
2016-11-250個贊
Cours dans la section correspondante:Glisser-déposer HTML5
拖放(Drag和drop)是HTML5標準的組成部分。 ondragstart:調(diào)用了一個函數(shù),drag(event),它規(guī)定了被拖動的數(shù)據(jù) setData():設(shè)置被拖數(shù)據(jù)的數(shù)據(jù)類型和值。 ondragover:事件規(guī)定在何處放置被拖動的數(shù)據(jù)。 ondrop:當(dāng)放置被拖放數(shù)據(jù)時,會發(fā)生drop事件
2016-11-250個贊
Cours dans la section correspondante:Fonction tutoriel de base Javascript avec paramètres
function sum(參數(shù)1,參數(shù)2){ 函數(shù)代碼; }
2016-11-250個贊
function msg(){ var sum = 15; return sum; }
2016-11-250個贊
Cours dans la section correspondante:balise d'entrée
name: 標識表單提交時的key值 min: 標識當(dāng)前輸入框輸入的最小值 max: 標識當(dāng)前輸入框輸入的最大值 step: 標識點擊增大/減小的時候,增加/減小的步長
2016-11-250個贊
Cours dans la section correspondante:Nouveaux attributs pour les formulaires HTML5
autofocus屬性 此屬性可以設(shè)置當(dāng)前頁面中input標簽加載完畢后獲得焦點 multiple 用于文件上傳控件,設(shè)置此屬性后,允許上傳多個文件。
2016-11-250個贊
Cours dans la section correspondante:Exemples complets
<input type="range" min="0" max="50" step="5" name="range" value="0" /> <output name="output">0</output> <br /> <input type="submit" value="提交表單" /> </form> 表單外的input標簽: <input type="text" form="form1" name="demo" />
2016-11-250個贊
Cours dans la section correspondante:Le contexte de l’origine du stockage local
瀏覽器還限制站點可以在用戶計算機上存儲的 Cookie 的數(shù)量。大多數(shù)瀏覽器只允許每個站點存儲 20 個Cookie;如果試圖存儲更多 Cookie,則最舊的 Cookie 便會被丟棄
2016-11-250個贊
Cours dans la section correspondante:Stockage local permanent?: localStorage
setItem(key,value)添加本地存儲數(shù)據(jù)。兩個參數(shù),非常簡單就不說了。 getItem(key)通過key獲取相應(yīng)的Value。 removeItem(key)通過key刪除本地數(shù)據(jù)。 clear()清空數(shù)據(jù)。
2016-11-250個贊