//滚动 function marquee(i, direction) { var obj = document.getElementById("marquee" + i); var obj1 = document.getElementById("marquee" + i + "_1"); var obj2 = document.getElementById("marquee" + i + "_2"); if (direction == "up") { if (obj2.offsetTop - obj.scrollTop <= 0) { obj.scrollTop -= (obj1.offsetHeight + 20); } else { var tmp = obj.scrollTop; obj.scrollTop++; if (obj.scrollTop == tmp) { obj.scrollTop = 1; } } } else { if (obj2.offsetWidth - obj.scrollLeft <= 0) { obj.scrollLeft -= obj1.offsetWidth; } else { obj.scrollLeft++; } } } function marqueeStart(i, direction) { var obj = document.getElementById("marquee" + i); var obj1 = document.getElementById("marquee" + i + "_1"); var obj2 = document.getElementById("marquee" + i + "_2"); obj2.innerHTML = obj1.innerHTML; var marqueeVar = window.setInterval("marquee("+ i +", '"+ direction +"')", 20); obj.onmouseover = function(){window.clearInterval(marqueeVar);} obj.onmouseout = function(){marqueeVar = window.setInterval("marquee("+ i +", '"+ direction +"')", 20);} } //屏蔽鼠标右键 function disabledRightButton() { document.oncontextmenu = function(e){return false;} document.onselectstart = function(e){return false;} if (navigator.userAgent.indexOf("Firefox") > -1) { document.writeln(""); } } // 设为首页 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',双击即可。"); return; } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', vrl); } } } // 加入收藏 function addFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("您使用的浏览器不支持此功能,请使用Ctrl+D进行添加"); } } } function flashPlay( pics, texts, links, flash_width, flash_height, text_height){ var swf_height = flash_height + text_height; var banner = '' document.write(''); document.write(banner); document.write(''); document.write(''); document.write(''); document.write(''); } // 内页左右等高 // $(document).ready(function(){ // var hRight = $(".main").height(); // var hLeft = $(".sidebar").height(); // if(hLeft>hRight){ // $(".sidebar").css("height",hLeft); // $(".main").css("height",hLeft); // }else{ // $(".sidebar").css("height",hRight); // $(".main").css("height",hRight); // } // }) // 回到顶部 // $(window).scroll(function(){ // var scrollH = $(window).scrollTop(); // if(scrollH>300){ // $(".back-top").fadeIn(); // }else{ // $(".back-top").fadeOut(); // } // }) // 回到顶部效果 $(document).ready(function(){ $(".back-top").on('click',function(){ $('html,body').animate({'scrollTop':0},500); }); }) // 在线QQ $(function(){ var m_woo_panel = $('#m-woo-panel'); $('#j-close').on('click',function(){ m_woo_panel.hide(); }); $('#j-console').on("click",function(){ if($(this).hasClass("m-console-active")){ $(this).removeClass("m-console-active"); m_woo_panel.animate({right:0}); }else{ $(this).addClass("m-console-active"); m_woo_panel.animate({right:-164}); }; }); }); // QQ滚动特效 $(document).ready(function(){ $("#m-woo-panel").floatadv(); }); jQuery.fn.floatadv = function(loaded) { var obj = this; body_height = parseInt($(window).height()); block_height = parseInt(obj.height()); top_position = parseInt((body_height/2) - (block_height/2) + $(window).scrollTop()); if (body_height