sso

suspension.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. $(document).ready(function () {
  2. /* ----- 侧边悬浮 ---- */
  3. $(document).on("mouseenter", ".suspension .a", function () {
  4. var _this = $(this);
  5. var s = $(".suspension");
  6. var isService = _this.hasClass("a-service");
  7. var isServicePhone = _this.hasClass("a-service-phone");
  8. var isQrcode = _this.hasClass("a-qrcode");
  9. if (isService) {
  10. s.find(".d-service").show().siblings(".d").hide();
  11. }
  12. if (isServicePhone) {
  13. s.find(".d-service-phone").show().siblings(".d").hide();
  14. }
  15. if (isQrcode) {
  16. s.find(".d-qrcode").show().siblings(".d").hide();
  17. }
  18. });
  19. $(document).on("mouseleave", ".suspension, .suspension .a-top", function () {
  20. $(".suspension").find(".d").hide();
  21. });
  22. $(document).on("mouseenter", ".suspension .a-top", function () {
  23. $(".suspension").find(".d").hide();
  24. });
  25. $(document).on("click", ".suspension .a-top", function () {
  26. $("html,body").animate({
  27. scrollTop: 0
  28. });
  29. });
  30. $(window).scroll(function () {
  31. var st = $(document).scrollTop();
  32. var $top = $(".suspension .a-top");
  33. if (st > 400) {
  34. $top.css({
  35. display: 'block'
  36. });
  37. } else {
  38. if ($top.is(":visible")) {
  39. $top.hide();
  40. }
  41. }
  42. });
  43. });
  44. // 下面的悬浮框
  45. $(function(){
  46. $(window).scroll(function(){
  47. height = $(window).scrollTop();
  48. if(height > 30){
  49. $('.wraper-1vdHN1Z2BV').fadeIn(300);
  50. }else{
  51. $('.wraper-1vdHN1Z2BV').fadeOut(100);
  52. }
  53. })
  54. });
  55. // 百度商桥
  56. $(function(){
  57. // 点击按钮时判断 百度商桥代码中的“我要咨询”按钮的元素是否存在,存在的话就执行一次点击事件
  58. $(".a-service").click(function(event) {
  59. if ($('#nb_invite_ok').length > 0) {
  60. $('#nb_invite_ok').click();
  61. }
  62. });
  63. });