$(function () { document.onkeydown = function (e) { var theEvent = window.event || e; var code = theEvent.keyCode || theEvent.which; if (code == 13) { return false; } } //音频播放 $(".audioImg").on("click",function(){ var curHtml = $(this).parent().find(".audioUrl").html(); var curAlt = $(this).attr("alt"); window.external.AudiovisualPlay(curAlt); }); //视频播放 $(".videoImg").on("click",function(){ var curHtml = $(this).parent().find(".videoUrl").html(); var curAlt = $(this).attr("alt"); window.external.AudiovisualPlay(curAlt); }); $(".oralLanguageHide").hide(); try { var tempJson=new Array(); $.each($(".yaoshi").parent().find(".underlineContent"), function (index, item) { tempJson[index]=$(item).text(); }) var isStu=window.external.IsStudent(); if(!isStu){ $('.underline').css("color","#fff"); $('.underline').css("border-bottom-color","rgb(151, 151, 151)"); $('.underline').css("border-bottom-width","1px"); $('.underline').css("border-bottom-style","solid"); $('.underline').css("word-break","break-all"); //答案控制 $('.yaoshi').on("click", function () { try{ var curDisplay = $(this).nextUntil(".yaoshi").filter(".underlineContent").eq(0).css("display"); if(curDisplay == "undefined"||curDisplay == undefined) return; if(curDisplay == "none"){ $(this).nextUntil(".yaoshi").filter(".underlineContent").show() }else{ $(this).nextUntil(".yaoshi").filter(".underlineContent").hide(); } }catch (e) { } }) $(".yaoshi").on("mouseenter", function () { $(this).css("cursor", "pointer!important"); var curDis = $(this).nextUntil(".yaoshi").filter(".underlineContent").css("display"); if (curDis == "inline") { $(this).attr("title", "隐藏答案"); } else if (curDis == "none") { $(this).attr("title", "显示答案"); } }) $(".audioImg").on("mouseenter", function () { $(this).css("cursor", "pointer"); $(this).attr("title", "播放音频"); }) $(".videoImg").on("mouseenter", function () { $(this).css("cursor", "pointer"); $(this).attr("title", "播放视频"); }) return; } $("body").click(function(event){ var $this = event.target; if($this.className != "yaoshi"){ $(".yaoshi1").hide(); $(".yaoshi2").hide(); } }); //修改钥匙图片css var innerHTML1 = ""; //修改钥匙图片css //var innerHTML2 = ""; $("body").append(innerHTML1); //$("body").append(innerHTML2); $('.yaoshi').attr("src","../../images/second/text-n.png"); $('.yaoshi').css("width","22px"); $('.yaoshi').css("height","24px"); $('.yaoshi').css("margin-left","1px"); $('.yaoshi').css("margin-top","5px"); $('.yaoshi').css("position","absolute"); $('.yaoshi').css("text-indent","0"); $('.yaoshi').css("text-align","left"); $('.underlineContent').css("display","none"); $('.underline').css("display","none"); $('.btn_file').off("change"); $('.btn_file').on("change",function(){ }); //根据父子集关系获取钥匙下放所以元素集合 var unTagName=$('.yaoshi').parent(); var unTagChildName= unTagName.children(); var tempBool = true; var inpbool= true; //alert(unTagChildName.length); for(var i=0; i