main.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. $(function(){
  2. /*导航触发*/
  3. $(".header-menu > ul > li").hover(function() {
  4. $(this).find(".sub-menu-ul").slideDown(600, 'easeOutBack');
  5. },function() {
  6. $(this).find(".sub-menu-ul").slideUp(300, 'easeInOutBack');
  7. });
  8. /*search*/
  9. $('.header-share ul li').eq(0).hover(function(){
  10. $(this).find('.search').stop().animate({'width':'309px','border-width':'1px'},325);
  11. },function(){
  12. $(this).find('.search').stop().animate({'width':'0px','border-width':'0px'},325);
  13. });
  14. $('.menu-icon').click(function() {
  15. if ($(".header-right").css('display') == 'none') {
  16. $(".header-right").stop().slideDown(650, 'easeOutQuart');
  17. $('.header-menu > ul > li').addClass('header-li-show');
  18. $(this).addClass('on');
  19. } else {
  20. $(".header-right").stop().slideUp(350, 'easeInQuad');
  21. $('.header-menu > ul > li').removeClass('header-li-show');
  22. $(this).removeClass('on');
  23. }
  24. });
  25. var winW = $(window).width();
  26. if (winW < 768) {
  27. $(".footer-menu > ul > li").click(function(){
  28. if ($(this).find(".menu-warp").css('display') == 'none') {
  29. $(this).find(".menu-warp").stop().slideDown(600, 'easeOutBack');
  30. $(this).addClass('move');
  31. } else {
  32. $(this).find(".menu-warp").stop().slideUp(800, 'easeInOutBack');
  33. $(this).removeClass('move');
  34. }
  35. });
  36. $('.code-txt').click(function(){
  37. if($(this).parent().find('.code-img').css('display') == 'none'){
  38. $(this).parent().find('.code-img').fadeIn();
  39. }else{
  40. $(this).parent().find('.code-img').hide();
  41. }
  42. });
  43. }
  44. });
  45. var top = window.screen.height / 2 - 250;
  46. var left = window.screen.width / 2 - 300;
  47. var winW = $(window).width(),
  48. winH = $(window).height();
  49. /*title是标题,rLink链接,summary内容,site分享来源,pic分享图片路径,分享到新浪微博*/
  50. function shareTSina(title, rLink, site, pic) {
  51. title = "智慧云创安全,我想了解更多!";
  52. // pic = $(".p-img img").attr("src");
  53. rLink = window.location.href;
  54. site = window.location.href;
  55. window.open("http://service.weibo.com/share/share.php?&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&url=" + encodeURIComponent(rLink), "分享至新浪微博", "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
  56. }
  57. /*分享到facebook*/
  58. function shareFB(title, rLink, summary, site, pic) {
  59. title = "智慧云创安全,我想了解更多!";
  60. rLink = window.location.href;
  61. site = window.location.href;
  62. window.open('http://www.facebook.com/sharer.phpu=' + encodeURIComponent(location.href) + '&site=' + encodeURIComponent(site), '_blank', 'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
  63. }
  64. // 腾讯微博
  65. function shareToWb(title, rLink, site, pic) {
  66. title = "智慧云创安全,我想了解更多!";
  67. rLink = window.location.href;
  68. site = window.location.href;
  69. window.open('http://v.t.qq.com/share/share.php?url=' + encodeURIComponent(rLink) + '&title=' + encodeURI(title) + '&appkey=' + encodeURI(site), '_blank', 'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
  70. }
  71. /*分享到qq空间*/
  72. function shareQzone(title, rLink, summary, site, pic) {
  73. title = "智慧云创安全,我想了解更多!";
  74. rLink = window.location.href;
  75. summary = "智慧云创安全,我想了解更多!";
  76. site = window.location.href;
  77. window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=' + encodeURIComponent(title) + '&url=' + encodeURIComponent(rLink) + '&summary=' + encodeURIComponent(summary) + '&site=' + encodeURIComponent(site), '_blank', 'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
  78. }
  79. // QRcode
  80. $(function () {
  81. // project
  82. $(".project-type").on("click", "li", function () {
  83. var index = $(".project-type>li").index(this);
  84. $(this).siblings("li").removeClass("active");
  85. $(this).addClass("active");
  86. $(".project-board>ul").hide();
  87. $(".project-board>ul").eq(index).show();
  88. })
  89. });