判断按钮按下 html5,如果Else按钮在HTML5中被按下?

我正在做一个数字艺术课的简单项目。我想做一个简单的小选择你自己的冒险游戏,在那里你看一个剪辑,然后选择几个不同的选项下一步做什么。你的决定会触发一段视频,冒险将持续一段时间,玩家将会逃离鬼屋或被杀。这是我第一次使用HTML5。如果Else按钮在HTML5中被按下?

我需要做以下事情: 1)当按下按钮时,播放某个视频。 2)视频结束后,屏幕顶部的文本块会相应变化,向玩家提供更多信息并比剪辑本身提供的更详细地解释其选项。

现在,我只需要帮助第1步。我似乎无法弄清楚如何让按钮onclick命令正常工作。该程序显示第一个简介视频就好了,但当您点击任何按钮时根本没有反应。我最初希望能够使用某些if-else button.pressed命令,但在HTML5中找不到类似的东西。我知道它无法解决我的代码,因为没有人可以访问我的本地文件,但我会很感激任何建议。谢谢!

这里是我的代码:

Spooks: Choose Your Own Adventure

function $(id)

{

return document.getElementById(id);

}

//Video Source Changers

function Door()

{

$('movie').src = "file:///C:/Users/Spencer/Videos/Spooks/Trapped.mp4" type="video/mp4">

}

function Wander()

{

$('movie').src = "file:///C:/Users/Spencer/Videos/Spooks/Sesame.mp4" type="video/mp4">

}

function Match()

{

$('movie').src = "file:///C:/Users/Spencer/Videos/Spooks/Sesame.mp4" type="video/mp4">

}

What an awful time to get stranded out in the countryside! It's raining cats and dogs out here. Hungry, freezing, exhausted and desperate, you head to the nearest visible shelter - a decrepit old mansion. Surely southern hospitality will see you safely through the night.

This is creepy. I'll just go back through the front door.

Really weird, but I guess it beats the storm. The owner probably just ran off to get the lights working. I'll wander around a bit, see if I can find him.

It'd be nice to be able to see before I make a decision one way or the other. Let's light a match...

2014-11-24

Spencer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值