我使用的图片库代码为每张幻灯片分配了一个ID。我想创建一个功能,当用户点击" next"在" img-7"上,用户进入" img-8"但然后被送回" img-7" 5秒后。
我有" setTimeout(" jump,5000")"当用户点击" next"时点击激活在img-7上,但是如何设置" jump"功能?我知道" window.location.href"用于更改窗口,但如何将其设置为跳转到图库中的其他ID?
function jump(){
}

<input type="radio" name="radio-btn" id="img-7" />
<li class="slide-container">
<div class="video-container">
<div class="slide">
<video id="video7" width="100%" loop muted>
<source src="files/video/7.webm" type="video/webm">
</video>
</div>
</div>
<div class="nav">
<label for="img-6" class="prev"></label>
<label for="img-8" class="next" onclick="setTimeout(jump,5000)"></label>
</div>
</li>
<input type="radio" name="radio-btn" id="img-8" />
<li class="slide-container">
<div class="video-container">
<div class="slide">
<video id="video8" width="100%" loop muted>
<source src="files/video/8.webm" type="video/webm">
</video>
</div>
</div>
<div class="nav">
<label for="img-7" class="prev"></label>
<label for="img-9" class="next"></label>
</div>
</li>
&#13;
答案 0 :(得分:0)
您不需要用引号括起class timetable(object):
def __init__(self, date):
self.date = date
def outGet(self):
print("timetable output: ", self.date)
class timetableUpperClass(object):
def newSubject(self, subjectDate):
# Define new Class
execThis = ("day_" + str(subjectDate) + " = timetable(" + str(subjectDate) + ")")
exec(execThis, globals())
# Get output
execThisTwo = ("day_" + str(subjectDate) + ".outGet()")
print("working command: ", execThisTwo)
exec(execThisTwo, globals())
p = timetableUpperClass()
p.newSubject(20170829)
的内部。
setTimeout
<label for="img-8" class="next" onclick="setTimeout("jump,5000")></label>
被解释为onclick
,因为onclick="setTimeout("
的引文正在关闭jump
。
相反,onClick
应为:
onclick