如何使用JavaScript播放多媒体文件?
要使用JavaScript播放多媒体文件,您可以尝试运行以下代码-
示例
<html>
<head>
<title>JavaScript Animation</title>
<script>
<!--
var imgObj = null;
function init(){
imgObj = document.getElementById('myImage');
imgObj.style.position= 'relative';
imgObj.style.left = '0px';
}
function moveRight(){
imgObj.style.left = parseInt(imgObj.style.left) + 10 + 'px';
}
window.onload = init;
//-->
</script>
</head>
<body>
<form>
<img id = "myImage" src = /images/html.gif" />
<p>Click button below to move the image to right</p>
<input type="button" value="Click Me" onclick="moveRight();" />
</form>
</body>
</html>热门推荐
5 初八祝福语简短语
10 六一祝福语简短感动女生
11 十月简短祝福语
12 幼儿狗年祝福语大全简短
13 参加儿子大学祝福语简短
14 六一婚礼文案祝福语简短
15 端午老师祝福语简短优美
16 公司上班祝福语大全简短
17 对航母的祝福语简短
18 新房开工吉日祝福语简短