【发布时间】:2017-06-02 13:06:18
【问题描述】:
我有大量代码要编程,但我被卡住了。
我正在做一个包含 4 个文档的游戏:html、css、javascript 和 jquery。该游戏是关于尝试用不同的图像猜测世界上 20 个不同的国家。我被困在我不知道我必须做什么的点上,所以游戏的每一轮它都会在图片之间自动选择。另外,它只需要显示第一张图片,如果玩家点击按钮获得提示,则其他图片开始显示。
我所有的图片都是这样组织的: 图片/ 图片/国家/地区/ img/国家/地区名称01.jpg img/国家/地区名称02.jpg img/国家名称/国家名称03.jpg img/countryname/countryname04.jpg
在我的 html 文档中,我创建了以下 div:
<pre>
<div id="country">
<div id="hint0">
<!--choose randomly "img/countryname/countryname01.jpg"-->
</div>
<div id="hint1" class="hint" style="display: none">
<!--choose randomly "img/countryname/countryname02.jpg"-->
</div>
<div id="pista2" class="pista" style="display: none">
<!--choose randomly "img/countryname/countryname03.jpg"-->
</div>
<div id="pista3" class="pista" style="display: none">
<!--choose randomly "img/countryname/countryname03.jpg"-->
</div>
</div>
</pre>
【问题讨论】:
-
看看这篇关于通过 Javascript 检索图像的帖子stackoverflow.com/questions/6994212/…
标签: javascript jquery html css image