//禁止复制 function nomenuone() {alert('版权所有,禁止复制'); return false; } document.oncontextmenu = nomenuone; //客服代码 $(function(){ var kf = $(".kefu"); var wkbox = $(".kefu-box"); var kf_close = $(".kefu .kefu-close"); var icon_kefu = $(".icon-kefu"); var kh = wkbox.height(); var kw = wkbox.width(); var wh = $(window).height(); $(kf_close).click(function(){ kf.animate({width:"0"},200,function(){ wkbox.hide(); icon_kefu.show(); kf.animate({width:30},300); }); }); $(icon_kefu).click(function(){ $(this).hide(); wkbox.show(); kf.animate({width:kw},200); }); }); //返回顶部 $(function(){ $('a[href*=#],area[href*=#]').click(function() { console.log(this.pathname) if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); if ($target.length) { var targetoffset = $target.offset().top; $('html,body').animate({ scrolltop: targetoffset }, 600); return false; } } }); }) //加入收藏 function shoucang(stitle,surl) { try { window.external.addfavorite(surl, stitle); } catch (e) { try { window.sidebar.addpanel(stitle, surl, ""); } catch (e) { alert("加入收藏失败,请使用ctrl+d进行添加"); } } }