English
<!-- Add the following code to the <body> area--> <script language="JavaScript"> <!-- //This function only needs to be in the onclick event of the cell to be clicked during the calling process Just call the showme function // function showme (obj1, obj2) This function mainly highlights the clicked object and calls the moveme function. The parameter obj1 is the id of the parent <div> tag, and obj2 is the clicked object itself // function moveme(obj) This function determines the movement of the unit and calls the corresponding function processing. The obj parameter is the parent body // function moveup(obj, objtop) This function makes a unit move upward. The parameter obj is the parent body and objtop is the parent body itself. Maximum height // function movedown (obj, objbuttom) This function moves a unit downward. The parameter obj is the parent body, and objbuttom is the lowest height of the parent body itself. var headHeight = 22; // The height of each title var bodyHeight = 160;/ /Matrix height var objcount = 6; //The number of items. If you want to change the number of items, don’t forget this var step = 6; //Moving speed (please confirm that it can be divided by 'bodyHeight-headHeight', currently The optional setting speed is 1, 2, 3, 6, 23, 138) var moving = false; // Whether there is a moving item function showme(obj1, obj2) { //The following loop is to change the background color of the title if (moving ) return; moving = true; for(i=0;i<document.all.tags("td").length;i++) if (document.all.tags("td")[i].className.indexOf( 'headtd') == 0) document.all.tags("td")[i].className = 'headtd1'; obj2.className = 'headtd2'; moveme(obj1); } function moveme(obj) { idnumber = parseInt(obj.id.substr(4)); objtop = headHeight * (idnumber - 1); objbuttom = bodyHeight + headHeight * (idnumber - 2); currenttop = parseInt(obj.style.top); if (currenttop >= objbuttom) { //Check out each layer that should be moved upwards countid = 1; for(i=0;i<document.all.tags("div").length;i++) if (document.all.tags(" div")[i].id == 'item'+countid+'body') { obj = document.all.tags("div")[i]; objtop = headHeight * (countid - 1); if (countid = = idnumber) { moveup(obj,objtop,false); break; } else moveup(obj,objtop,true); countid++; } } else if ((currenttop <= objtop) && (idnumber < objcount)) { //check Out of each layer that should be moved down idnumber++; countid = objcount; for(i=document.all.tags("div").length-1;i>=0;i--) if (document.all.tags ("div")[i].id == 'item'+countid+'body') { obj = document.all.tags("div")[i]; objbuttom = bodyHeight + headHeight * (countid - 2); if (countid == idnumber) { movedown(obj,objbuttom,false); break; } else movedown(obj,objbuttom,true); countid--; } } } function moveup(obj,objtop,ismove) { currenttop = parseInt (obj.style.top); if (currenttop > objtop) { obj.style.top = currenttop - step; setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1 ) return; }<center> <script language="javascript"> function preview() { bdhtml=window.document.body.innerHTML; sprnstr="<!--startprint-->"; eprnstr="<!-- endprint-->"; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window. print(); //prnform.htext.value=prnhtml; //prnform.submit(); //alert(prnhtml); } </script> These contents will not be printed<br> +++++ ++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++ <center>This part and above will not be printed</center> <!--startprint--> <table width="70%" align="center" bgcolor="#0000FF" cellpadding="2" cellspacing="1"> <tr bgcolor="#6699FF"> <td> <div align="center">Title 1</div> </td> <td> <div align="center ">Title 2</div> </td> <td> <div align="center">Title 3</div> </td> <td> <div align="center">Title 4</div> </td> </tr> <tr bgcolor="#6699FF"> <td> </td> <td> </td> <td> </td> <td> </td> </tr> < /table> <!--endprint--> +++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++<br> These contents will not The printed <div align="center"> <input type="button" name="print" value="Preview and print" onclick="preview()"> </div> </center>