jquery.common.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. $(document).ready(function()
  2. {
  3. //给所有J_hoverbut的元素增加hover样式
  4. $(".J_hoverbut").hover(
  5. function() {
  6. $(this).addClass("hover");
  7. },
  8. function() {
  9. $(this).removeClass("hover");
  10. }
  11. );
  12. //个人会员中心小标题切换卡
  13. $(".thtab .li").click(function() {
  14. $(this).addClass("select").siblings(".li").removeClass("select");
  15. var index = $(".thtab .li").index(this);
  16. $('.tabshow').eq(index).show().siblings(".tabshow").hide();
  17. });
  18. //新增简历页面 点击重命名简历标题,切换出文本框
  19. $("#J_edit_title").click(function() {
  20. $("#J_edit_title_input").show();
  21. $("#J_edit_title_txt").hide();
  22. });
  23. $("#J_edit_title").click(function() {
  24. $("#J_edit_title_input").show();
  25. var oval = $("#J_edit_title_input").find('input[name="title"]').val();
  26. $("#J_edit_title_input").find('input[name="title"]').val('').focus().val(oval).addClass('input_focus');
  27. $("#J_edit_title_txt").hide();
  28. });
  29. $('input[name="title"]').blur(function() {
  30. $("#J_edit_title_input").hide();
  31. $("#J_edit_title_txt").show();
  32. });
  33. $('input[name="title"]').keyup(function() {
  34. $("#J_edit_title_txt span").html($(this).val());
  35. });
  36. //给符合条件的的文本框增加获取焦点的边框和背景变化
  37. $(".J_focus input[type='text'][dir!='no_focus'],.J_focus textarea[dir!='no_focus']").focus(function() {
  38. $(this).addClass("input_focus")
  39. });
  40. $(".J_focus input[type='text'][dir!='no_focus'],.J_focus textarea[dir!='no_focus']").blur(function() {
  41. $(this).removeClass("input_focus")
  42. });
  43. //给符合条件的的DIV文本框增加获取焦点的边框和背景变化
  44. $(".J_hoverinput").hover(
  45. function() {
  46. $(this).addClass("input_focus");
  47. },
  48. function() {
  49. $(this).removeClass("input_focus");
  50. }
  51. );
  52. //新增简历页面打开关闭更多选项
  53. $("#J_addmore").click(function() {
  54. $("#J_addmore_show").toggle();
  55. if ($("#J_addmore_show").is(':hidden')) {
  56. $(this).removeClass('show');
  57. } else {
  58. $(this).addClass('show');
  59. }
  60. });
  61. //编辑简历页滑过项目显示编辑和删除
  62. $(".J_course_edit").hover(
  63. function() {
  64. $(this).find(".editbox").show();
  65. },
  66. function() {
  67. $(this).find(".editbox").hide();
  68. }
  69. );
  70. //编辑简历页点击添加和修改显示对应表单
  71. $(".J_show_itemsform").click(function() {
  72. $(this).parent().parent().hide();
  73. $(this).parent().parent().next().show();
  74. });
  75. $(".J_hide_itemsform").click(function() {
  76. $(this).parent().parent().parent().parent().hide();
  77. $(this).parent().parent().parent().parent().prev().show();
  78. });
  79. $(".J_close_itemsform").click(function() {
  80. $(this).parent().parent().hide();
  81. $(this).parent().parent().prev().show();
  82. });
  83. });