You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.2 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. $(function(){
  2. //头部菜单
  3. $('.classreturn .nav_menu a:last').click(function(e){
  4. $('.tpnavf').toggle();
  5. e.stopPropagation();
  6. });
  7. //左侧导航
  8. $('.classlist ul li').click(function(){
  9. $(this).addClass('red').siblings().removeClass('red');
  10. });
  11. //设置图片长等于宽
  12. $(".imgzsy").height(function(){return $(this).width();});
  13. });
  14. //删除确认框
  15. function delconfirm(url,des)
  16. {
  17. if(!des){des='确定要删除吗?';}
  18. //询问框
  19. layer.open({
  20. content: des
  21. ,btn: ['确定', '取消']
  22. ,yes: function(index){
  23. location.href= url;
  24. layer.close(index);
  25. }
  26. });
  27. }
  28. //手机号验证
  29. function validatemobile(mobile)
  30. {
  31. if(mobile.length == 0 || mobile.length != 11)
  32. {
  33. return false;
  34. }
  35. var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
  36. if(!reg.test(mobile))
  37. {
  38. return false;
  39. }
  40. return true;
  41. }
  42. //提示层
  43. function messageNotice(message,time)
  44. {
  45. time = time*1000 || 3000;
  46. // 创建一个 Mask 层,追加到body中
  47. $('body').append('<div id="mask_msg"></div>');
  48. $('#mask_msg').html(message);
  49. $('#mask_msg').show();
  50. setInterval(function(){$('#mask_msg').remove();},time);
  51. }