Audiovisual.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*!
  2. * 视听说
  3. * author:andy
  4. * 2020-09-10
  5. */
  6. $(function () {
  7. $(".oralLanguageHide").hide();
  8. //音频播放
  9. $(".audioImg").on("click",function(){
  10. var curHtml = $(this).parent().find(".audioUrl").html();
  11. var curAlt = $(this).attr("alt");
  12. window.external.AudiovisualPlay(curAlt);
  13. });
  14. //视频播放
  15. $(".videoImg").on("click",function(){
  16. var curHtml = $(this).parent().find(".videoUrl").html();
  17. var curAlt = $(this).attr("alt");
  18. window.external.AudiovisualPlay(curAlt);
  19. });
  20. //答案控制
  21. $(".yaoshi").on("click",function(){
  22. try{
  23. var curDisplay = $(this).nextUntil(".yaoshi").find(".underlineContent").eq(0).css("display");
  24. if(curDisplay == "undefined"||curDisplay == undefined) return;
  25. if(curDisplay == "none"){
  26. $(this).nextUntil(".yaoshi").find(".underlineContent").show()
  27. }else{
  28. $(this).nextUntil(".yaoshi").find(".underlineContent").hide();
  29. }
  30. }catch (e) {
  31. }
  32. })
  33. })
  34. //样式控制
  35. $(function () {
  36. $(".left").on("mouseenter", ".yaoshi", function () {
  37. $(this).css("cursor", "pointer!important");
  38. var curDis = $(this).parent().find(".underlineContent").css("display");
  39. if (curDis == "inline") {
  40. $(this).attr("title", "隐藏答案");
  41. } else if (curDis == "none") {
  42. $(this).attr("title", "显示答案");
  43. }
  44. })
  45. $(".left").on("mouseenter", ".audioImg", function () {
  46. $(this).css("cursor", "pointer");
  47. $(this).attr("title", "播放音频");
  48. })
  49. $(".left").on("mouseenter", ".videoImg", function () {
  50. $(this).css("cursor", "pointer");
  51. $(this).attr("title", "播放视频");
  52. })
  53. $(".right").on("mouseenter", ".yaoshi", function () {
  54. $(this).css("cursor", "pointer!important");
  55. var curDis = $(this).parent().find(".underlineContent").css("display");
  56. if (curDis == "inline") {
  57. $(this).attr("title", "隐藏答案");
  58. } else if (curDis == "none") {
  59. $(this).attr("title", "显示答案");
  60. }
  61. })
  62. $(".right").on("mouseenter", ".audioImg", function () {
  63. $(this).css("cursor", "pointer");
  64. $(this).attr("title", "播放音频");
  65. })
  66. $(".right").on("mouseenter", ".videoImg", function () {
  67. $(this).css("cursor", "pointer");
  68. $(this).attr("title", "播放视频");
  69. })
  70. })