...
|
...
|
@@ -210,8 +210,8 @@ $(document).ready(function() { |
|
|
console.log(value.question);
|
|
|
let title = `
|
|
|
<div>
|
|
|
<div class='wenti-btn' id="question2" onClick="showAnswer(${value.id})" data-id='${key}'>${value.question}</div>
|
|
|
<p id="answer1" data-id='${key}' style="color:#323232"></p>
|
|
|
<div class='wenti-btn' id="question2" onClick="showAnswer(${value.id})" data-id='${key}'>${value.question}</div>
|
|
|
<p id="answer${value.id}" data-id='${key}' style="color:#323232"></p>
|
|
|
</div>`
|
|
|
$('#clickQuestion').append(title)
|
|
|
})
|
...
|
...
|
@@ -229,20 +229,11 @@ function showAnswer(id) { |
|
|
// 调用公共ajax
|
|
|
ajax(url4, "GET", header1, params1, function(res) {
|
|
|
console.log(res);
|
|
|
// $('#answer1').html(res.data)
|
|
|
// $(self).addClass("wenti-btn").siblings().removeClass("wenti-btn");
|
|
|
// var getele = $(self).attr("data-id");
|
|
|
// $("#"+getele).removeClass("hide").siblings().addClass("hide");
|
|
|
|
|
|
// var i = 0;
|
|
|
// console.log(i);
|
|
|
// if (i % 2 == 0) {
|
|
|
// document.getElementById('question2').style.color = '#66ca94'
|
|
|
// $('#answer1').html(res.data)
|
|
|
|
|
|
// } else {
|
|
|
// document.getElementsById('question2').style.color = '#323232'
|
|
|
// }
|
|
|
console.log($('#answer' + id).parent().parent().find('p').html(''))
|
|
|
console.log($('#answer' + id).parent().parent().find('.wenti-btn').css('color', 'black'));
|
|
|
$('#answer' + id).parent().find('#question2').css('color', 'green')
|
|
|
$('#answer' + id).html(res.data)
|
|
|
console.log($(this))
|
|
|
}, function(res) {
|
|
|
console.log(res);
|
|
|
|
...
|
...
|
|