为什么Reveal.js Reveal.next不一致地移到演示文稿的开头?

时间:2018-11-16 15:26:57

标签: reveal.js

我正在使用Reveal.Next()函数从演示文稿中的链接移至下一张幻灯片。用户回答一个问题,然后隐藏或显示div并告诉他们答案是否正确,并显示“继续下一张幻灯片”链接。

问题是,链接有时会转到演示文稿的开头,有时会转到预期的下一张幻灯片。

下面是代码示例:

<section class="present" style="display: block;">
    <div class="row">
        <div class="col-md-12">
            <p class="txt-left">The answer to the question is:</p>                      
            <div style="padding-left:20px;">                                
                <div class="radio txt-left">    
                    <input type="radio" id="opt-1" name="opt-1" value="1" onchange="$('#correct1').show();$('#incorrect1').hide();"/>
                    <label for="opt-1">This one?</label>
                </div>                          
                <div class="radio txt-left">
                    <input type="radio" id="opt-2" name="opt-1" value="2" onchange="$('#incorrect1').show();$('#correct1').hide();"/>
                    <label for="opt-2">How about this?</label>
                </div>                              
                <div class="radio txt-left">
                    <input type="radio" id="opt-3" name="opt-1" value="3" onchange="$('#incorrect1').show();$('#correct1').hide();"/>
                    <label for="opt-3">Maybe this is correct?</label>
                </div>
                <div class="radio txt-left">
                    <input type="radio" id="opt-4" name="opt-1" value="4" onchange="$('#incorrect1').show();$('#correct1').hide();"/>
                    <label for="opt-4">Could this be right?</label>
                </div>  
                <div class="radio txt-left">
                    <input type="radio" id="opt-5" name="opt-1" value="5" onchange="$('#incorrect1').show();$('#correct1').hide();"/>
                    <label for="opt-5">Last but not least?</label>
                </div>                                  
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="alert alert-success collapse" id="correct1">
              <p class="txt-left"><strong>Correct!</strong></p> 
              <p><a href="#" onclick="Reveal.next();">Continue to the Next Slide.</a></p>
            </div>
            <div class="alert alert-danger collapse" id="incorrect1">
              <p class="txt-left"><strong>Incorrect!</strong></p> 
              <p><a href="#" onclick="Reveal.next();">Continue to the Next Slide.</a></p>
            </div>                          
        </div>
    </div>
</section>

0 个答案:

没有答案