Pointer Events In 15 Minutesswap doms
var div_cont = document.createElement('div'); var div1 = document.createElement('div'); div1.setAttribute('id', 'div1'); div1.innerHTML = 'Div One'; var div2 = document.createElement('div'); div2.setAttribute('id', 'div2'); div2.innerHTML = 'Div Two'; but aqua glare = []; div_array[0] = div1; div_array[1] = div2; for (var i=0; i<div_array.length; i+=1) { div_cont.appendChild(div_array[i]); } document.body.appendChild(div_cont); div_cont.onclick = function() { if (div_array[0] === div1){ div_array[0] = div2; div_array[1] = div1; } else if (div_array[0] === div2){ div_array[0] = div1; div_array[1] = div2; } for (var i=0; i<div_array.length; i+=1) { div_cont.appendChild(div_array[i]); } }swap doms by css only
table-header-group table-footer-group table-row-group /* the functional important stuff */ .container { display:table;} .div1 { display:table-footer-group; } .div2 { display:table-row-group;} .div3 { display:table-header-group;} <div class="container"> <div class="div1"> <span>1</span> </div> <div class="div2"> <span>2</span> </div> <div class="div3"> <span>3</span> </div> </div> Using CSS element{ display: table-footer-group; } Using Javascript object.style.display="table-footer-group";body onload multiple functions
function start(){ func1(); func2(); func3(); } body onload="start()"list all arrays in JavaScript
var house = ["red","blue","yellow"]; var car = ["fast","big","safe"]; var sofa = ["cozy","modern","elegant"]; var arrayCount = 0; var arrayString = ""; for (var property in window) { if (Array.isArray(window[property])){ arrayCount++; arrayString += arrayCount > 1 ? ", " + property : property; } } console.log(arrayCount + " arrays - " + arrayString);canvas draw circle
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.arc(100, 75, 50, 0, 2 * Math.PI); ctx.stroke(); Centerarc(100,75,50,0*Math.PI,1.5*Math.PI) // Center 100,75 Start anglearc(100,75,50,0,1.5*Math.PI) // Start angle 0 End anglearc(100,75,50,0*Math.PI,1.5*Math.PI) // End angle 1.5*Math.PI context.arc(x,y,r,sAngle,eAngle,counterclockwise); create a circle with arc(): Set start angle to 0 and end angle to 2*Math.PI. Use the stroke() or the fill() method to actually draw the arc on the canvas.remove null value from array
Math.min(...[].concat(...dataDiff).filter(function(val) { return val !== null }))remove max and min
arr.filter(e => e != Math.min(...arr)); arr.filter(e => e != Math.max(...arr));