//加入收藏 function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle) } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, "") } catch (e) { alert("加入收藏失败,请使用Ctrl+D进行添加") } } } //设置为主页 function SetHome(obj, vrl) { try { obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl); } catch (e) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。"); } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', vrl); } else { alert("您的浏览器不支持,请按照下面步骤操作:1.打开浏览器设置。2.点击设置网页。3.输入:" + vrl + "点击确定。"); } } } //返回顶部 $(function() { $.fn.manhuatoTop = function(options) { var defaults = { showHeight: 150, speed: 1000 }; var options = $.extend(defaults, options); $("#totop").prepend(""); var $toTop = $(this); var $top = $("#totop"); var $ta = $("#totop a"); $toTop.scroll(function() { var scrolltop = $(this).scrollTop(); if(scrolltop >= options.showHeight) { $top.show(); }else { $top.hide(); } }); $ta.hover(function() { $(this).addClass("cur"); }, function() { $(this).removeClass("cur"); }); $top.click(function() { $("html,body").animate({ scrollTop: 0 }, options.speed); }); } }); //返回顶部 function GetBackTop(){ $('body,html').animate({scrollTop: 0},1000); } $(function() { $(window).manhuatoTop({ showHeight: 100, //设置滚动高度时显示 speed: 500 //返回顶部的速度以毫秒为单位 }); }); var $ = jQuery; var window_Width = $(window).width(); var window_Height = $(window).height(); $(window).resize(function(){ window_Width = $(window).width(); window_Height = $(window).height(); SetPageZoom(); }); function SetPageZoom(){ if(window_Width<=1500 && window_Width>=750){ $(".warp,.Warp").css({"max-width":"1500px","zoom":(window_Width/1500)}) }else{ $(".warp,.Warp").css({"max-width":"2560px","zoom":"1"}) } } SetPageZoom(); //检索、菜单 $(".jiansuo").click(function(){ setTimeout(function(){ $(".search-box").addClass("showdiv"); },200); }) $(".close_js").click(function(){ setTimeout(function(){ $(".search-box").removeClass("showdiv"); },200); }) $(".caidan").click(function(){ setTimeout(function(){ $(".nav_menu").addClass("showdiv"); },200); }) $(".close_lm").click(function(){ setTimeout(function(){ $(".nav_menu").removeClass("showdiv"); },200); }) //微信微博分享 function fenxiang_wx(url){ window.open('sharepage/index.html?url=' + url); } function fenxiang_wb(url,title){ window.open("http://service.weibo.com/share/share.php?url=" + url + "&title=" + title); }