jquery.common.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // JavaScript Document
  2. $(document).ready(function()
  3. {
  4. //给所有J_hoverbut的元素增加hover样式
  5. $(".J_hoverbut").hover(
  6. function()
  7. {
  8. $(this).addClass("hover");
  9. },
  10. function()
  11. {
  12. $(this).removeClass("hover");
  13. }
  14. );
  15. //首页BANER右侧选项卡切换
  16. $(".noticestab .tli").click( function () {
  17. $(this).addClass("select").siblings(".tli").removeClass("select");
  18. var index = $(".noticestab .tli").index(this);
  19. $('.notice_showtabs').eq(index).show().siblings(".notice_showtabs").hide();
  20. });
  21. //首页底部资讯选项卡切换
  22. $(".newstab .newstli").click( function () {
  23. $(this).addClass("select").siblings(".newstli").removeClass("select");
  24. var index = $(".newstab .newstli").index(this);
  25. $('.news_showtabs').eq(index).show().siblings(".news_showtabs").hide();
  26. });
  27. //给符合条件的的文本框增加获取焦点的边框和背景变化
  28. $(".J_focus input[type='text'][dir!='no_focus'],.J_focus textarea[dir!='no_focus'],.J_focus input[type='password']").focus(function(){
  29. $(this).addClass("input_focus")
  30. });
  31. $(".J_focus input[type='text'][dir!='no_focus'],.J_focus textarea[dir!='no_focus'],.J_focus input[type='password']").blur(function(){
  32. $(this).removeClass("input_focus")
  33. });
  34. });