HTML&javaSkcript&CSS&jQuery&ajax(十)

HTML

1、SVG直接嵌入HTML网页 ,SVG 是使用XML描述2D图像的语言,Canvas通过JavaScript来绘制2D

      <svg xmlns="http://www.w3.org/200/svg" version="1.1" height="190">

            <polygon point="100,10,40,190,60,10,190,190"   style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"/></svg>

2、MathML <math xmlns="http://ww.w3org/1998/Math/MathMl">

               <mrow>     <msup><mi>a</mi><mn>2</mn></msup>     <mo>+</mo>  <msup><mi>a</mi><mn>2</mn></msup> <mo>=</mo>

           <msup><mi>c</mi><mn>2</mn></msup>  </mrow>  </math>

3、图片拖放 先定义内联 <style type="text/css">

     #div1{ width:"350px;height:"70px;padding:10px; border:1px;solid #aaaaaa;}</style>

     <script>  function allowDrop(ev){

                         ev.preventDefault();}

                          function drag(ev){

                       ev.dataTransfer.setData("Text",ev.target.id);}

            function drop(ev){

                               ev.preventDefault();

                         var data=ev.dataTransefaer.getData("Tesxt");

                          ev.target.appendChild(document.getElementById(data);)}</script>

                  <div id="div1" ondrop="drop(event)" ondragover="allowdrop(event)"></div>

 <br>   <img id="drag1" src="/image/logo.png" draggable="true" ondragstart="drag(event)" width="100" height="100">

</body>

 4、获取地址位置经纬度 <script> var x=doucment.getElementById("demo");

               function getLocation(){

                   if (navigation.geolocation){

                       navigation.geolocation.getCurrentPosition(showPostion);

                 }else{

                             x.innerHTML="该浏览器不支持活动的地理位置"}}

                           function showPosition(position){

                                    x.innerHTML="纬度” +position.coords.lattitude+“经度”+position.coords.longtitude;}</script>

5、Video视屏处理标签  <div style="text-align:center">

                     <button onclick="playPause()">暂停/播放</button>

                      <button onlick="makeBog()">放大</button>

                     <button onlick="makeSmall()>缩小</button>

                      <button onlick="makeNormal()">普通</button><br>

                <video id="video1" width="420">  <source="mov_bbb.mp4" type="video/mp4">

               <souce src="mov_bbb.ogg" type="video/ogg"></video></div>

                   <script>  var myVideo=document.getElementById("video1");

                           function playPause(){

                                                  if(myVideo.paused)

                                                  myVideo.play();

                                               else   myVideo.pause();

                                       }

                                       function makeBig(){ myVideo.width=560;}

                                    function makeSmall(){myVideo.width=320;}</script>

6、audio标签    <audio controls><source src="horse.ogg": type="audio/ogg">

                                               <source src="horse.mp3" type="audio/mpeg"></audio>

7、输入颜色   <form action="demo-form.php"> 选择你喜欢的颜色<input type="color" name="favcolor"></br>

                  <input type="submit":></form>

8、输入日期 标签   <form action="demo-form.php"> 你的生日<input type="date" name="SueKay">

                                    <input type="submit":></form>    <!-- 其他的邮件地址 等等都是一个类型>

9、 输入限制的数字 <form action=" demo-form.php">

                <input type="number" name="quantity" min="1" max="5">

                  <input type=“submit”></form>

      滑动栏的形式限制     <form action=" demo-form.phjp">    Points" <input type="range" name="points" min=1" max="5">

                                 <input type="submit“> </form>

10、HTML表单元素  

datalist 元素  <input  l;ist="browsers">   <datalist id="browsers"> <option value="Internet Explorer">

                                        <option value="Firefox">   <option value="Chrome"> </datalist>

     

posted @ 2018-02-28 11:53  疏桐  阅读(153)  评论(0编辑  收藏  举报
function e(n){ return document.getElementsByTagName(n) } function t(){ var t=e("script"),o=t.length,i=t[o-1]; return{ l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.5),c:n(i,"color","0,0,0"),n:n(i,"count",99) } } function o(){ a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight } function i(){ r.clearRect(0,0,a,c); var n,e,t,o,m,l; s.forEach(function(i,x){ for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e=n.max/2&&(i.x-=.03*o,i.y-=.03*m), t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke())) }), x(i) } var a,c,u,m=document.createElement("canvas"), d=t(),l="c_n"+d.l,r=m.getContext("2d-disabled"), x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame|| function(n){ window.setTimeout(n,1e3/45) }, w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o, window.onmousemove=function(n){ n=n||window.event,y.x=n.clientX,y.y=n.clientY }, window.onmouseout=function(){ y.x=null,y.y=null }; for(var s=[],f=0;d.n>f;f++){ var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3}) } u=s.concat([y]), setTimeout(function(){i()},100) }();