我正在开发一个 HTML5 Windows 应用程序,其中一个屏幕在上、左和右侧有 3 个图像,如下图红色标记所示。
我只想通过单击按钮时滑出图像来隐藏这三个图像。请提供有关如何使用 HTMl5/javascript 执行此操作的代码
程序的代码在这里
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TamilKarpom</title>
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
<script>
function diffImage(img) {
if (img.src.match("images/on_btn.png")) {
console.log('Low');
img.src = "images/off_btn.png";
}
else {
console.log('up');
img.src = "images/on_btn.png";
}
}
</script>
<!-- TamilKarpom references -->
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
</head>
<body>
<img src="images/Title.png" id="full-screen-background-image"/>
<img src="images/yellow.png" id="image4" style="position:absolute; height: 734px; left: 1195px; top: 41px; width: 229px;"/>
<img src="images/glow.png" style="position:absolute" id="full-screen" />
<a href="uyireluthukkal.html">
<img src="images/blue.png" id="image3" style="position:absolute; left: 253px; top: -100px; width: 880px; height: 276px;"/>
</a>
<img src="images/red.png" id="image2" style="position:absolute; width: 220px; left: -48px; top: 24px; height: 734px;"/>
<img src="images/title_01.png"style="position:absolute; left: 330px; top: 58.5px; width: 700px; height: 630px;" />
<img style="position:absolute; left: 593.5px; top: 636.33px; width: 171px; height: 122.5px;" src="images/off_btn.png" id="image1" onclick="diffImage(this); "/>
</body>
</html>