$(document).ready(function() { $("#navbar li div>a").wrapinner( '' ); $("#navbar li div>a").each(function() { $( '' + $(this).text() + '' ).appendto( this ); }); $("#navbar li").hover(function() { $(".out", this).stop().animate({'top': '40px'}, 300); // move down - hide $(".over", this).stop().animate({'top': '0px'}, 300); // move down - show $("dl", this).slidedown(); // move down - show }, function() { $(".out", this).stop().animate({'top': '0px'}, 300); // move up - show $(".over", this).stop().animate({'top': '-40px'}, 300); // move up - hide $("dl", this).slideup(); // move up - hide }); }); 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); } } }