|
|
@@ -247,31 +247,31 @@ function bindEventYS() {
|
|
|
|
|
|
//显示/隐藏习题答案
|
|
|
$(".yaoshi").on("click", function () {
|
|
|
- var ParentAnid = $(this).attr("parent-anid");
|
|
|
+ var parentAnid = $(this).attr("parent-anid");
|
|
|
if ($(this).attr("data-status") == "0") {
|
|
|
// 显示处理
|
|
|
- if (ParentAnid != undefined) {
|
|
|
- $.each($(this).parents().find(".yaoshi[parent-anid='" + ParentAnid + "']"), function (index, FItem) {
|
|
|
- $(FItem).attr("data-status", "1");
|
|
|
- $(FItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
- $.each($(FItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
- var ULCText = $(this).text(); // 获取文本内容
|
|
|
- var WidthValue = $(item).css("width");
|
|
|
- var NClsName = $(item).next().attr("class");
|
|
|
- if (NClsName != "ULCFZShow") {
|
|
|
- var AddHtml = "";
|
|
|
- if (HasChineseWorld(ULCText)) {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ if (parentAnid != undefined) {
|
|
|
+ $.each($(this).parents().find(".yaoshi[parent-anid='" + parentAnid + "']"), function (index, fItem) {
|
|
|
+ $(fItem).attr("data-status", "1");
|
|
|
+ $(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
+ $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
else {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
- $(item).css("display", "inline-block").after(AddHtml);
|
|
|
+ $(item).css("display", "inline-block").after(addHtml);
|
|
|
}
|
|
|
else {
|
|
|
$(item).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
}
|
|
|
- if (ULCText.indexOf("√") > -1) {
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
$(this).parent().find(".checkbox").find("input").prop('checked', true);
|
|
|
}
|
|
|
if (!$(item).hasClass("no-answer")) {
|
|
|
@@ -290,23 +290,23 @@ function bindEventYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
- var ULCText = $(this).text(); // 获取文本内容
|
|
|
- var WidthValue = $(item).css("width");
|
|
|
- var NClsName = $(item).next().attr("class");
|
|
|
- if (NClsName != "ULCFZShow") {
|
|
|
- var AddHtml = "";
|
|
|
- if (HasChineseWorld(ULCText)) {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
else {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
- $(item).css("display", "inline-block").after(AddHtml);
|
|
|
+ $(item).css("display", "inline-block").after(addHtml);
|
|
|
}
|
|
|
else {
|
|
|
$(item).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
}
|
|
|
- if (ULCText.indexOf("√") > -1) {
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
$(this).parent().find(".checkbox").find("input").prop('checked', true);
|
|
|
}
|
|
|
if (!$(item).hasClass("no-answer")) {
|
|
|
@@ -327,29 +327,29 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
// 隐藏处理
|
|
|
- if (ParentAnid != undefined) {
|
|
|
- $.each($(this).parents().find(".yaoshi[parent-anid='" + ParentAnid + "']"), function (index, FItem) {
|
|
|
- $(FItem).attr("data-status", "0");
|
|
|
- $(FItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
- $.each($(FItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
- var ULCText = $(this).text(); // 获取文本内容
|
|
|
- var WidthValue = $(item).css("width");
|
|
|
- var NClsName = $(item).next().attr("class");
|
|
|
- if (NClsName != "ULCFZShow") {
|
|
|
- var AddHtml = "";
|
|
|
- if (HasChineseWorld(ULCText)) {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ if (parentAnid != undefined) {
|
|
|
+ $.each($(this).parents().find(".yaoshi[parent-anid='" + parentAnid + "']"), function (index, fItem) {
|
|
|
+ $(fItem).attr("data-status", "0");
|
|
|
+ $(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
+ $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
else {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
- $(item).css("display", "none").after(AddHtml);
|
|
|
+ $(item).css("display", "none").after(addHtml);
|
|
|
$(item).next().attr("data-status", "1");
|
|
|
}
|
|
|
else {
|
|
|
$(item).css("display", "none").next().attr("data-status", "1");
|
|
|
}
|
|
|
- if (ULCText.indexOf("√") > -1) {
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
$(this).parent().find(".checkbox").find("input").prop('checked', false);
|
|
|
}
|
|
|
$(item).css("color", "#ffffff");
|
|
|
@@ -363,24 +363,24 @@ function bindEventYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
- var ULCText = $(this).text(); // 获取文本内容
|
|
|
- var WidthValue = $(item).css("width");
|
|
|
- var NClsName = $(item).next().attr("class");
|
|
|
- if (NClsName != "ULCFZShow") {
|
|
|
- var AddHtml = "";
|
|
|
- if (HasChineseWorld(ULCText)) {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
else {
|
|
|
- AddHtml = "<span class='ULCFZShow' style='width:" + WidthValue + ";' data-status='0'> </span>";
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
}
|
|
|
- $(item).css("display", "none").after(AddHtml);
|
|
|
+ $(item).css("display", "none").after(addHtml);
|
|
|
$(item).next().attr("data-status", "1");
|
|
|
}
|
|
|
else {
|
|
|
$(item).css("display", "none").next().attr("data-status", "1");
|
|
|
}
|
|
|
- if (ULCText.indexOf("√") > -1) {
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
$(this).parent().find(".checkbox").find("input").prop('checked', false);
|
|
|
}
|
|
|
$(item).css("color", "#ffffff");
|
|
|
@@ -408,8 +408,8 @@ function bindEventYS() {
|
|
|
}
|
|
|
|
|
|
// 判断是否存在中文(true表示存在)
|
|
|
-var HasChineseWorld = function(DataStr){
|
|
|
- if (escape(DataStr).indexOf("%u") < 0)
|
|
|
+var hasChineseWorld = function (dataStr) {
|
|
|
+ if (escape(dataStr).indexOf("%u") < 0)
|
|
|
{
|
|
|
return false;
|
|
|
}
|