global.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. $(function(){
  2. $(".indexAskList li").hover(function () {
  3. $(this).addClass("hover");
  4. },
  5. function () {
  6. $(this).removeClass("hover");
  7. }
  8. );
  9. $(".expertBox li").hover(function () {
  10. $(this).addClass("now").siblings("li").removeClass("now");
  11. }
  12. );
  13. $(".exproList .exproItem").hover(function () {
  14. $(this).addClass("hover").children(".exproExtra").slideDown("fast").siblings(".exproItem").removeClass("hover");
  15. },
  16. function () {
  17. $(this).removeClass("hover").children(".exproExtra").slideUp("fast")
  18. }
  19. );
  20. $(".agreeThis").hover(function () {
  21. $(this).addClass("agreeThisHover");
  22. },
  23. function () {
  24. $(this).removeClass("agreeThisHover");
  25. }
  26. );
  27. $(".agreeThisDis").hover(function () {
  28. $(this).addClass("agreeThisDisHover");
  29. },
  30. function () {
  31. $(this).removeClass("agreeThisDisHover");
  32. }
  33. );
  34. $("div.msgEntry h3").click(function () {
  35. $(this).siblings(".sysMsgDetail").slideDown("fast");
  36. });
  37. $(".msgDetailUpBtn a").click(function () {
  38. $(this).parents(".sysMsgDetail").slideUp("fast");
  39. });
  40. $('a.loginBtn').click(function(){
  41. $(".loginPanel").slideToggle();
  42. $(this).toggleClass("focus");
  43. if ($(this).hasClass('focus')) $(this).find('span').html('▲')
  44. else $(this).find('span').html('▼')
  45. });
  46. $(".loginPanel").click(function (e) {
  47. e.stopPropagation();
  48. });
  49. $(".userLoginPanel > li").hover(function () {
  50. $(this).addClass("focus").children(".myListMenu").show();
  51. },
  52. function () {
  53. $(this).removeClass("focus").children(".myListMenu").hide();
  54. }
  55. );
  56. function newsScroll(id) {
  57. var box = $("#"+id+ " span");
  58. $("<span>").html(box.html()).appendTo(box.parent());
  59. var w = box.width();
  60. var i = 0;
  61. var move = function () {
  62. box[0].style.marginLeft = -i+"px";
  63. i++;
  64. if (i === w) {
  65. i = 0;
  66. }
  67. };
  68. var auto = setInterval(move, 40);
  69. $("#index-news span a").hover(function (){
  70. clearInterval(auto);
  71. }, function (){
  72. auto = setInterval(move, 40);
  73. })
  74. }
  75. if (document.getElementById("index-news")){
  76. newsScroll("index-news");
  77. };
  78. $(".chargeEntry > h2 > .payBtn").click(function(){
  79. $(this).hide().parents("h2").siblings(".chargeItem").slideDown("fast");
  80. });
  81. $(".chargeItem .btn-gray").click(function(){
  82. $(this).parents(".chargeItem").slideUp("fast").siblings("h2").children(".payBtn").show();
  83. });
  84. $(".chargeEntry").hover(function(){
  85. $(this).addClass("focus").siblings().removeClass("focus")
  86. },
  87. function(){$(this).removeClass("focus")}
  88. );
  89. $(".tabTips").fadeIn("slow");
  90. setTimeout( function(){$( '.tabTips' ).fadeOut("slow");}, 3000 );
  91. $(".searchInput").hover(function () {
  92. $(this).children(".searchDocBtn").show();
  93. },
  94. function () {
  95. $(this).children(".searchDocBtn").hide();
  96. }
  97. );
  98. });