|
@@ -201,13 +201,29 @@ common={
|
|
|
_this.onSocket(e);
|
|
|
}
|
|
|
|
|
|
- },loadQuestion(responsedata) {
|
|
|
+ },randomNum:function(minNum,maxNum){
|
|
|
+ switch(arguments.length){
|
|
|
+ case 1:
|
|
|
+ return parseInt(Math.random()*minNum+1,10);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },loadQuestion(responsedata) {
|
|
|
console.log(responsedata);
|
|
|
|
|
|
var _this=this;
|
|
|
_this.data.isAnswer=false;
|
|
|
_this.data.question_id= responsedata.info.question.question_id;
|
|
|
+ var animate=["zoomInDown","bounceIn","flash"];
|
|
|
+ var r = _this.randomNum(0,2);
|
|
|
+
|
|
|
$("#Jqtitle").html(responsedata.info.question.title );
|
|
|
+ $("#Jqtitle").addClass(animate[r]);
|
|
|
var question="";
|
|
|
var answers = responsedata.info.options
|
|
|
for(var i in answers){
|
|
@@ -300,6 +316,7 @@ common={
|
|
|
if (_this.data.sum < 0) {
|
|
|
if(!_this.data.isAnswer)
|
|
|
_this.Answer();
|
|
|
+ $("#Jqtitle").attr("class","tit");
|
|
|
_this.data.sum = 9;
|
|
|
_this.data.angle = 0;
|
|
|
leftContent.setAttribute('style', 'transform: rotate(0deg)');
|