|
|
@@ -226,7 +226,31 @@ function bindEventYS() {
|
|
|
|
|
|
//显示/隐藏习题答案
|
|
|
$(".yaoshi").on("click", function () {
|
|
|
+ // 隐藏答案
|
|
|
+ var NClsName = $(this).parent().attr("class") + " correntQue";
|
|
|
+ var PClsName = $(this).parent().attr("class").replace(" correntQue", "");
|
|
|
+ var NextClsName = $(this).parent().next().attr("class");
|
|
|
+ var PreClsName = $(this).parent().prev().attr("class");
|
|
|
if ($(this).attr("data-status") == "0") {
|
|
|
+ if (NClsName == NextClsName) {
|
|
|
+ $(this).parent().next().find(".yaoshi").attr("data-status", "1");
|
|
|
+ $(this).parent().next().find(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
+ $.each($(this).parent().next().find(".underlineContent"), function (index, item) {
|
|
|
+ if (!$(item).hasClass("no-answer")) {
|
|
|
+ $(item).css("color", "#92D050");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).css("color", "#989898");
|
|
|
+ }
|
|
|
+ $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
+ $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (PClsName == PreClsName) {
|
|
|
+ $(this).parent().prev().find(".yaoshi").attr("data-status", "1");
|
|
|
+ $(this).parent().prev().find(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
+ $(this).parent().prev().find(".underlineContent").css("color", "#989898");
|
|
|
+ }
|
|
|
$(this).attr("data-status", "1");
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
@@ -248,6 +272,20 @@ function bindEventYS() {
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
+ if (NClsName == NextClsName) {
|
|
|
+ $(this).parent().next().find(".yaoshi").attr("data-status", "0");
|
|
|
+ $(this).parent().next().find(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
+ $.each($(this).parent().next().find(".underlineContent"), function (index, item) {
|
|
|
+ $(item).css("color", "#ffffff");
|
|
|
+ $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
+ $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (PClsName == PreClsName) {
|
|
|
+ $(this).parent().prev().find(".yaoshi").attr("data-status", "0");
|
|
|
+ $(this).parent().prev().find(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
+ $(this).parent().prev().find(".underlineContent").css("color", "#ffffff").css("background-color", "#ffffff");
|
|
|
+ }
|
|
|
$(this).attr("data-status", "0");
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|