函数的一部分不起作用. [英] A part of a function is not working.

查看:193
本文介绍了函数的一部分不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于按正确的顺序排列混乱的字母以进行拼写.问题在中间的div中,字母围绕着它.单击字母将其逐个移至答案格以进行拼写.它工作正常,但是重新启动测验时,成绩div不会显示成绩.您能帮忙找出错误吗?

https://codepen.io/Tarun1980/pen/byQorp [

It''s about arranging the jumbled letters in correct order to make a spelling. The question is in the middle div and the letters are around it. Clicking the letter moves it to the answer div one by one to make the spelling. It''s working fine, but on restarting the quiz, the score div is not displaying the score. Could you please help to figure out the error?

https://codepen.io/Tarun1980/pen/byQorp[^]

What I have tried:

// Restarting Quiz

    $(document).on('click', '#summary a', restart);
    function restart()
    {
        i = 0;
        k = 0;
        n = 0;
        score = 0;

        $('#summary').fadeOut();
        $('#questionDiv').fadeIn();
        $('#answerDiv').empty();
        $('#answerDiv').fadeIn();
        $('#score').fadeIn();
        $('#btn').fadeIn();
        showQuestions();
        hello();
        world();
        createDivs();
    }
});

推荐答案

(文档).on(单击' #summary a',重新启动); 功能 restart() { i = 0 ; k = 0 ; n = 0 ; 分数= 0 ;
(document).on('click', '#summary a', restart); function restart() { i = 0; k = 0; n = 0; score = 0;


('
('#summary').fadeOut();


(#questionDiv').fadeIn();
('#questionDiv').fadeIn();


这篇关于函数的一部分不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆