【发布时间】:2014-12-19 22:15:38
【问题描述】:
好的,所以我有一个单选按钮幻灯片,我用一些简单的 CSS 和 HTML 制作,但现在我需要它每 3 秒更改一次,但我仍然希望它能够通过选中单选按钮来更改。 ..
这是我的 Css 代码
.photo {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 800px;
height: 300px;
opacity: 0;
transition: all 1s;
z-index: -1;
}
.container {
position: relative;
width: 800px;
height: 300px;
overflow: hidden;
margin: 10px;
text-align: center;
}
input[type=radio]:checked ~ .photo {
transition: all 1s;
opacity: 100;
}
.photo1 {
position: absolute;
bottom: 0;
right: 52%;
}
.photo2 {
position: absolute;
bottom: 0;
right: 50%;
}
.photo3 {
position: absolute;
bottom: 0;
right: 48%;
}
这是我的html代码
<table>
<tr>
<td>
<form class="container">
<table>
</tr>
<td>
<input type="radio" name="photo" class="photo1" checked="true">
<img src="Footloose.png" class="photo">
</td>
<td>
<input type="radio" name="photo" class="photo2" >
<img src="Shrek.jpg" class="photo">
</td>
<td>
<input type="radio" name="photo" class="photo3" >
<img src="LegallyBlond.jpg" class="photo">
</td>
</form>
</tr>
</table>
我是 Java 和 Javascript 的新手,当我尝试时,它不起作用。提前感谢您的帮助!
【问题讨论】:
-
java和javascript相距甚远
-
你的问题不清楚
标签: html css button timer radio