有兴趣创建具有特定功能的 HTA,但似乎无法让其正常工作/显示。有没有办法利用包含图像的 ImageMap 或 DIV,以便鼠标操作(悬停/单击/等)正常工作?ImageMap 很不错,因为我可以只使用一张图片,窗口可以识别区域,但我无法在鼠标操作时进行图片交换。ImageMap 无法实现图片交换功能吗?我也尝试过使用 DIV 进行像素精确尺寸标注,但浮动、清除、边距等总是存在问题,导致其看起来像下面的图片。HTA 根本无法实现此功能吗?如果不能,有什么替代方案?
如果我使用 HTA,它看起来是这样的......
如果我将其重命名为 HTM,它看起来如下...
<head>
<script type="text/javascript">
</script>
<script language="vbscript">
option explicit
dim width, height, idtimer
width=410
height=225
window.resizeto width, height
window.moveto screen.availwidth\2-width\2, screen.availheight\2-height\2
idtimer=window.settimeout("vbscript:window.close", 4000)
</script>
<style>
* { font:12px "segoe ui", sans-serif; margin:0; padding:0; }
div#container { height:225px; width:410px; }
div#title { background-color:blue; border-left:1px solid blue; border-top:1px solid blue; color:#fff; float:left; height:26px; padding-top:6px; width:376px; }
div#button { background-color:blue; border-top:1px solid blue; border-right:1px solid blue; color:#fff; float:left; height:32px; margin-left:377px; }
span#titletext { background-color:blue; color:#fff; padding-left:6px; width:360px; }
span#buttontext { background-color:blue; color:#fff; font-size:18px; padding-left:13px; width:32px; }
div#main { clear:both; height:125px; width:410px; }
div#graphic { background-color:#987; border-left:1px solid blue; float:left; height:125px; width:60px; }
div#content { background-color:#abc; border-right:1px solid blue; float:left; height:125px; width:348px; }
div#footer { background-color:#eee; border-left:1px solid blue; border-bottom:1px solid blue; border-right:1px solid blue; clear:both; height:40px; width:408px; }
</style>
</head>
<hta:application applicationname="Index" id="Index" border="none" borderstyle="normal" caption="no" commandline="" contextmenu="no" icon="" innerborder="no" maximizebutton="no" minimizebutton="no" navigable="no" scroll="no" scrollflat="no" selection="no" showintaskbar="no" singleinstance="yes" sysmenu="no" systemmenu="no" version="" windowstate="normal" />
<body>
<div id="container">
<div id="title"><span id="titletext">Index</span></div>
<div id="button"><span id="buttontext">x</span></div>
<div id="main">
<div id="graphic"></div>
<div id="content"></div>
</div>
<div id="footer"></div>
</body>
</html>```