mzx16822 6 éve
szülő
commit
41dcddd64d
1 módosított fájl, 12 hozzáadás és 3 törlés
  1. 12 3
      resources/views/home/user.blade.php

+ 12 - 3
resources/views/home/user.blade.php

@@ -424,9 +424,18 @@ var rules={
                 onEnterPress:function () {
                   // body...
                   if(main.current.classList.contains("item")){
-                    var answerId=$(this.current).attr("data-id");
-                    $(this.current).addClass("cur_answer");
-                    answer(answerId);
+                    var ischeck=false
+                    for (var i = 0; i < this.hotbtn.length; i++) {
+                      if(this.hotbtn[i].classList.contains("cur_answer")){
+                        ischeck=true;
+                      }
+                    }
+                    if(ischeck){
+                      var answerId=this.current.getAttribute("data-id");
+                      this.current.classList.add("cur_answer");
+                      answer(answerId);
+                    }
+                    
                   }
                   
                 },