The jquery library file is a little large, so in some cases you need to replace jquery with pure js. If you need it, you can refer to the jquery library file. In some cases, you need to minimize the size of the loaded files (file size) and use pure js to compile the results.
$('#layer')document.getElementById('layer')$('#layer span')var layer = document.getElementById('layer');var span = layer.getElementsByTagName('span');$('#inner').parent()document.getElementById("inner").parentNode$(window).width();document.body.clientWidth$('#layer').width();document.getElementById('layer').style.width$('#wrap').append('a');var span=document.createElement("span");span.innerHTML='a';document.getElementById("wrap").appendChild(span);$('#wrap span').remove();deleteSpan();function deleteSpan(){var content=document.getElementById("wrap");var childs=content.getElementsByTagName("span");if(childs.length > 0){content.removeChild(childs[childs.length-1]);deleteSpan();}}$('#wrap').css({'left':'100px'});var wrap = document.getElementById('wrap');wrap.style.left = '100px';$('#banner').hide();document.getElementById('banner').style.display = 'none';$('#banner').show();document.getElementById('banner').style.display = 'block';$('#people').addClass('people_run2');document.getElementById("people").classList.add('people_run2');$('#people').removeClass('people_run1');document.getElementById("people").classList.remove('people_run1');$('#number').text(1);document.getElementById('number').innerHTML = 1;
$. Ajax ({type: "POST", url: 'Run. php ', data:'s =' + last_step, dataType: "JSON", timeout: 2000, success: function (data) {// processing callback }}); // 1. create the XMLHTTPRequest object var xmlhttp; if (window. XMLHttpRequest) {// IE7 +, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest; // fix bugs in some specific versions of the javasillar browser if (xmlhttp. overrideMimeType) {xmlhttp. overrideMimeType ('text/xml') ;};} else if (window. activeXObject) {// IE6, IE5 xmlhttp = new ActiveXObject ("Microsoft. XMLHTTP ") ;}; if (xmlhttp. upload) {// 2. the callback function // onreadystatechange is the event handle function xmlhttp called every time the readyState attribute changes. onreadystatechange = function (e) {if (xmlhttp. readyState = 4) {if (xmlhttp. status = 200) {var json = eval ('+ xmlhttp. responseText + '); // process callback }}; // 3. set connection information // initialize HTTP request parameters, but do not send requests. // The first parameter connection method, the second is the url address, and the third true is the asynchronous connection. The default value is asynchronous // the post method is used to send data xmlhttp. open ("POST", "/run. php ", true); // 4. send data, start interacting with the server // send an HTTP request, use the parameters passed to the open () method, and the optional requests passed to the method if true, the send statement will be executed immediately // if it is false (synchronous ), the send method is executed only when the server data is returned. // The get method does not require the content var formdata = new FormData (); formdata. append ("s", last_step); xmlhttp. send (formdata );}
$('btn').bind({'touchstart':function(){}});document.getElementById("btn").ontouchstart = function(){};