index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* ============================================================
  2. * index.js 首页js集合
  3. * ============================================================
  4. * Copyright aix.
  5. * ============================================================ */
  6. !function($) {
  7. // 顶部搜索类型切换
  8. $('.J_sli').click(function() {
  9. $(this).addClass('select').siblings().removeClass('select');
  10. var typeValue = $.trim($(this).data('type'));
  11. $('#top_search_type').val(typeValue);
  12. if(typeValue == 'AIX_jobslist'){
  13. $.getJSON(list_show_type_url,{action:'hotword',type:1});
  14. }else if(typeValue == 'AIX_resumelist'){
  15. $.getJSON(list_show_type_url,{action:'hotword',type:3});
  16. }else if(typeValue == 'AIX_companylist'){
  17. $.getJSON(list_show_type_url,{action:'hotword',type:2});
  18. }
  19. })
  20. // 顶部回车搜索
  21. $('#top_search_input').bind('keypress', function(event) {
  22. if (event.keyCode == "13") {
  23. $("#top_search_btn").click();
  24. }
  25. })
  26. // 登录方式切换
  27. $('#forMobileLogin').click(function() {
  28. var thisIndex = $(this).data('index');
  29. $('#J_loginType').val(thisIndex);
  30. $('.switch_txt').eq(thisIndex).addClass('active').siblings('.switch_txt').removeClass('active');
  31. $('.type_box').eq(thisIndex).addClass('active').siblings('.type_box').removeClass('active');
  32. $('#forAccountLogin').show();
  33. });
  34. $('#forAccountLogin').click(function() {
  35. var thisIndex = $(this).data('index');
  36. $('#J_loginType').val(thisIndex);
  37. $('.switch_txt').eq(thisIndex).addClass('active').siblings('.switch_txt').removeClass('active');
  38. $('.type_box').eq(thisIndex).addClass('active').siblings('.type_box').removeClass('active');
  39. $('#forAccountLogin').hide();
  40. });
  41. }(window.jQuery);