[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[转载代码] hta 实现的四色域移

本帖最后由 CrLf 于 2014-8-17 17:23 编辑

代码为转载
从存货里翻出来的,其实是个很简单的功能,但当示例不错:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <style type="text/css">
  6. html{
  7. overflow:hidden;
  8. }
  9. .body {
  10.     background-repeat:repeat;
  11.     height:2000px;
  12.     width: 2000px;
  13. }
  14. button {
  15.     boder:0;
  16.     height: 20px;width:61px;
  17. }
  18. </style>
  19. </head>
  20. <SCRIPT Language="JavaScript">
  21. function Move(a,b,c,d){
  22.         A="on";B="on";
  23.         if (a<c) {X=('+')} else {X=('-')}
  24.         if (b<d) {Y=('+')} else {Y=('-')}
  25.         if (b==d) B="off";if (a==c) A="off"
  26.         for (H=0;H<=2000;H++) {
  27.                 parent.scroll(a,b)
  28.                 if (A=="on") eval("a"+X+"=1")
  29.                 if (B=="on") eval("b"+Y+"=1")
  30.         }
  31. }
  32. </SCRIPT>
  33. <body style="background-color: #707070; background-image: url('background.bmp');width: 81px; height: 610px" class="style1" >
  34. <div class="body">
  35. <div style="position: absolute; width: 500px; height: 500px; z-index: 1; left: 0px; top: 0px; background: red" id="layer1">
  36.         <button onClick="Move(0,0,0,2000)">Green</BUTTON><br>
  37.         <button value="Blue" onClick="Move(0,0,2000,0)">Blue</BUTTON><br>
  38.         <button value="Yello" onClick="Move(0,0,2000,2000)">Yello</BUTTON><br>
  39.         <center><font size="72">Area_Red</font></center>
  40. </div>
  41. <div style="position: absolute; width: 500px; height: 500px; z-index: 1; left: 2000px; top: 0px; background: blue" id="layer2">
  42.         <button onClick="Move(2000,0,0,0)">Red</BUTTON><br>
  43.         <button onClick="Move(2000,0,0,2000)">Green</BUTTON><br>
  44.         <button onClick="Move(2000,0,2000,2000)">Yello</BUTTON><br>
  45.         <center><font size="72">Area_Blue</font></center>
  46. </div>
  47. <div style="position: absolute; width: 500px; height: 500px; z-index: 1; left: 0px; top: 2000px; background: green" id="layer1">
  48.         <button onClick="Move(0,2000,0,0)">Red</BUTTON><br>
  49.         <button onClick="Move(0,2000,2000,0)">Blue</BUTTON><br>
  50.         <button onClick="Move(0,2000,2000,2000)">Yello</BUTTON><br>
  51.         <center><font size="72">Area_Green</font></center>
  52. </div>
  53. <div style="position: absolute; width: 500px; height: 500px; z-index: 1; left: 2000px; top: 2000px; background: yellow" id="layer1">
  54.         <button value="Red" onClick="Move(2000,2000,0,0)">Red</BUTTON><br>
  55.         <button value="Green" onClick="Move(2000,2000,0,2000)">Green</BUTTON><br>
  56.         <button value="Blue" onClick="Move(2000,2000,2000,0)">Blue</BUTTON><br>
  57.         <center><font size="72">Area_Yello</font></center>
  58. </div>
  59. </body>
复制代码

返回列表