head.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. $(function () {
  2. $(".head_li_library").click(function(){
  3. window.location.href="../lanhu/index.html"
  4. })
  5. $(".head_li_Moments").click(function(){
  6. window.location.href="../moments/index.html"
  7. })
  8. $(".navbar .dropdown").mouseover(function () {
  9. $(this).addClass("open");
  10. });
  11. $(".navbar .dropdown").mouseleave(function(){
  12. $(this).removeClass("open");
  13. })
  14. $(".headSignout").click(function(){
  15. window.localStorage.removeItem("loginUser");
  16. window.localStorage.removeItem("loginCompany");
  17. $(".loginUserNo").show()
  18. $(".loginUser").hide()
  19. })
  20. var loginUser= window.localStorage.getItem("loginUser");
  21. if(loginUser){
  22. $(".loginUserNo").hide()
  23. $(".loginUser").show()
  24. $(".userName").text(loginUser)
  25. var loginCompany= window.localStorage.getItem("loginCompany");
  26. if(loginCompany){
  27. $(".head_add").attr("href","../company/postproject.html")
  28. }else{
  29. $(".head_add").attr("href","../company/register.html")
  30. }
  31. }
  32. })
  33. function jpalert(text,url,type){
  34. var success = $(".head_success").val();
  35. if(type==null){
  36. type="success"
  37. }
  38. if(type=="alert"){
  39. success= $(".head_warning").val();
  40. }
  41. zeroModal[type]({
  42. unique: '1',
  43. opacity: 0.8,
  44. content: success,
  45. contentDetail: text,
  46. width: '300px',
  47. height: '280px',
  48. ok:false,
  49. cancel:true,
  50. onClosed: function() {
  51. ; //location.href='../signin/signin.html'
  52. },
  53. onComplete: function(evn) {
  54. console.log('onComplete')
  55. setTimeout(function(){
  56. if(url){
  57. window.location.href=url
  58. }
  59. zeroModal.close('1');
  60. },3000);
  61. }
  62. })
  63. }