Kaynağa Gözat

优化处理答题点问题

namejr 4 yıl önce
ebeveyn
işleme
923b288806

+ 2 - 2
EBook.Web/Common/tasklib_book.css

@@ -72,8 +72,8 @@ p .answer-body:first-child{
 .underlineContent{
     display:inline;
 }
-.underlineContentShow{
-    display:none;
+.underlineContentShow[data-status='0']{
+    display:none !important;
 }
 .underlineContentShow[data-status='1']{
     display:inline-block;

+ 38 - 26
EBook.Web/Common/tasklib_book.js

@@ -1,5 +1,5 @@
 //播放音频图片地址
-var PicInfo = {
+var PicInfo1 = {
     answerPointImgUrl: "file:///android_asset/js/update-answer.png",
     yaoshiShowImgUrl: "file:///android_asset/js/yaoshi-show.png",
     yaoshiHideImgUrl: "file:///android_asset/js/yaoshi-hide.png",
@@ -10,7 +10,7 @@ var PicInfo = {
 }
 
 //本地调用用的资源
-var PicInfo1 = {
+var PicInfo = {
     answerPointImgUrl: "../Images/update-answer.png",
     yaoshiShowImgUrl: "../Images/yaoshi-show.png",
     yaoshiHideImgUrl: "../Images/yaoshi-hide.png",
@@ -134,16 +134,17 @@ function showHideAnswer(flag) {
         $(".underlineContent").css("color", "#92D050");
         $(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
         $.each($(".underlineContent"), function (index, item) {
+            var FontSizeValue = $(this).css("font-size");
             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'>&emsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                 }
                 else {
-                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                 }
                 $(item).css("display", "inline").after(addHtml);
             }
@@ -160,16 +161,17 @@ function showHideAnswer(flag) {
         $(".underlineContent").css("color", "#ffffff");
         $(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
         $.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
+            var FontSizeValue = $(this).css("font-size");
             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'>&emsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                 }
                 else {
-                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                 }
                 $(item).css("display", "none").after(addHtml);
                 $(item).next().attr("data-status", "1");
@@ -195,16 +197,17 @@ function showHideAnswerEx(isShowYX, isShowAS) {
 
     if (isShowAS) {
         $.each($(".underlineContent"), function (index, item) {
+            var FontSizeValue = $(this).css("font-size");
             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'>&emsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                 }
                 else {
-                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                 }
                 $(item).css("display", "inline").after(addHtml);
             }
@@ -229,16 +232,17 @@ function showHideAnswerEx(isShowYX, isShowAS) {
     }
     else {
         $.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
+            var FontSizeValue = $(this).css("font-size");
             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'>&emsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                 }
                 else {
-                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                    addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                 }
                 $(item).css("display", "none").after(addHtml);
                 $(item).next().attr("data-status", "1");
@@ -351,16 +355,17 @@ function bindEventTeaOrignalYS() {
                     $(item).attr("data-status", "1");
                     $(item).attr("src", PicInfo.yaoshiShowImgUrl);
                     $.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
+                        var FontSizeValue = $(this).css("font-size");
                         var underlineContentText = $(cItem).text();  // 获取文本内容
                         var widthValue = $(cItem).css("width");
                         var newClsName = $(cItem).next().attr("class");
                         if (newClsName != "underlineContentShow") {
                             var addHtml = "";
                             if (hasChineseWorld(underlineContentText)) {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&emsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                             }
                             else {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                             }
                             $(cItem).css("display", "inline").after(addHtml);
                         }
@@ -385,16 +390,17 @@ function bindEventTeaOrignalYS() {
                 $(this).attr("data-status", "1");
                 $(this).attr("src", PicInfo.yaoshiShowImgUrl);
                 $.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
+                    var FontSizeValue = $(this).css("font-size");
                     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'>&emsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                         }
                         else {
-                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                         }
                         $(item).css("display", "inline").after(addHtml);
                     }
@@ -427,16 +433,17 @@ function bindEventTeaOrignalYS() {
                     $(item).attr("data-status", "0");
                     $(item).attr("src", PicInfo.yaoshiHideImgUrl);
                     $.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
+                        var FontSizeValue = $(this).css("font-size");
                         var underlineContentText = $(cItem).text();  // 获取文本内容
                         var widthValue = $(cItem).css("width");
                         var newClsName = $(cItem).next().attr("class");
                         if (newClsName != "underlineContentShow") {
                             var addHtml = "";
                             if (hasChineseWorld(underlineContentText)) {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&emsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                             }
                             else {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                             }
                             $(cItem).css("display", "none").after(addHtml);
                             $(cItem).next().attr("data-status", "1");
@@ -457,16 +464,17 @@ function bindEventTeaOrignalYS() {
                 $(this).attr("data-status", "0");
                 $(this).attr("src", PicInfo.yaoshiHideImgUrl);
                 $.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
+                    var FontSizeValue = $(this).css("font-size");
                     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'>&emsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                         }
                         else {
-                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                         }
                         $(item).css("display", "none").after(addHtml);
                         $(item).next().attr("data-status", "1");
@@ -575,16 +583,17 @@ function bindEventYS() {
                     $(fItem).attr("data-status", "1");
                     $(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
                     $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
+                        var FontSizeValue = $(this).css("font-size");
                         var underlineContentText = $(this).text();  // 获取文本内容
                         var widthValue = $(item).css("width");
                         var newClsName = $(item).parent().find(".underlineContent").next().attr("class");
                         if (newClsName != "underlineContentShow") {
                             var addHtml = "";
                             if (hasChineseWorld(underlineContentText)) {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&emsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                             }
                             else {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                             }
                             $(item).css("display", "inline").after(addHtml);
                         }
@@ -610,16 +619,17 @@ 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 FontSizeValue = $(this).css("font-size");
                     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'>&emsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                         }
                         else {
-                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                         }
                         $(item).css("display", "inline").after(addHtml);
                     }
@@ -653,16 +663,17 @@ function bindEventYS() {
                     $(fItem).attr("data-status", "0");
                     $(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
                     $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
+                        var FontSizeValue = $(this).css("font-size");
                         var underlineContentText = $(this).text();  // 获取文本内容
                         var widthValue = $(item).css("width");
                         var newClsName = $(item).parent().find(".underlineContent").next().attr("class");
                         if (newClsName != "underlineContentShow") {
                             var addHtml = "";
                             if (hasChineseWorld(underlineContentText)) {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&emsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                             }
                             else {
-                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                                addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                             }
                             $(item).css("display", "none").after(addHtml);
                             $(item).next().attr("data-status", "1");
@@ -684,16 +695,17 @@ 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 FontSizeValue = $(this).css("font-size");
                     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'>&emsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&emsp;</span>";
                         }
                         else {
-                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'>&nbsp;</span>";
+                            addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";font-size:" + FontSizeValue + ";line-height:" + FontSizeValue + ";height:" + FontSizeValue + ";' data-status='0'>&nbsp;</span>";
                         }
                         $(item).css("display", "none").after(addHtml);
                         $(item).next().attr("data-status", "1");