質問編集履歴
1
jQueryが消えていたみたいです。
test
CHANGED
File without changes
|
test
CHANGED
@@ -644,7 +644,65 @@
|
|
644
644
|
|
645
645
|
```
|
646
646
|
|
647
|
-
|
647
|
+
```jQuery
|
648
|
+
|
649
|
+
$(function() {
|
650
|
+
|
651
|
+
$('#button1,#button2').click(function(){
|
652
|
+
|
653
|
+
var sub = $('input[name=subject]:checked').val();
|
654
|
+
|
655
|
+
var count = $('.study'+ sub).length;
|
656
|
+
|
657
|
+
var randomNum = Math.floor(Math.random() * (count - 1 + 1)) + 1;
|
658
|
+
|
659
|
+
var nth = 'nth-child(' + randomNum +')';
|
660
|
+
|
661
|
+
var val1 = $('#number1').val();
|
662
|
+
|
663
|
+
var number1 = Number(val1) || 0;
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
var val2 = $('#second1').val();
|
668
|
+
|
669
|
+
var number2 = Number(val2) || 0;
|
670
|
+
|
671
|
+
var number2a = number2 * 1000
|
672
|
+
|
673
|
+
var number2b = number2a + 1000
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
for(var i = 0; i <= number1; i++){
|
678
|
+
|
679
|
+
$('.study' + sub + ':' + nth).css('opacity','1');
|
680
|
+
|
681
|
+
$('#button1').css('opacity','0');
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
$('.answer' + sub + ':' + nth).delay(number2a).queue(function(){
|
686
|
+
|
687
|
+
$(this).css('opacity','1');
|
688
|
+
|
689
|
+
});
|
690
|
+
|
691
|
+
$('#button2').delay(number2b).queue(function(){
|
692
|
+
|
693
|
+
$(this).css('opacity','1');
|
694
|
+
|
695
|
+
});
|
696
|
+
|
697
|
+
}
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
});
|
702
|
+
|
703
|
+
});
|
704
|
+
|
705
|
+
```
|
648
706
|
|
649
707
|
### 試したこと
|
650
708
|
|