function slideto(eid,timer){ var itemw = $(eid).find("ul li").outerwidth(true); var count = $(eid).find("ul li").size(); $(eid).find("ul").width(itemw*count*2); $(eid).find("ul li").clone().appendto($(eid).find("ul")); var scleft = $(eid).scrollleft(); var scr = function(){ timer = setinterval(function(){ $(eid).scrollleft(scleft+=1) if(scleft>=itemw*count){ clearinterval(timer); scleft = 0; scr(); } },!-[1,]?5:10); } scr(); $(eid).hover(function(){clearinterval(timer)},function(){scr();}); } function scrollbox(fw){ $("#scrollbox ul").width($("#scrollbox ul li").size()*72); $("#scrollbox").stop(true,true).animate({scrollleft:$("#scrollbox").scrollleft()+72*fw+"px"},400); } function rate(){ $(".ratesbox input:radio[name=rate]").change(function(){ $(".rate").removeclass().addclass("rate rate"+$(this).val()) }); } function docscroll(eid){ $("html,body").animate({scrolltop:$(eid).offset().top+"px"},800,"swing"); } function copyurl(){ try{ window.clipboarddata.setdata('text', document.location.href); alert("链接已复制到剪贴板\n你可以按crtl+v粘贴发送给朋友!"); }catch(e){ alert("您的浏览器不支持此操作,请手动复制") } } function fav(){ $(".hright .tips").fadein(200,function(){ settimeout(function(){ $(".hright .tips").fadeout(200); },5000); }); } function addfavorite(){ surl=document.location.href; stitle=document.title; try{ window.external.addfavorite(surl,stitle) }catch(e){ try{ window.sidebar.addpanel(stitle,surl,"") }catch(e){ alert("加入收藏失败,请使用ctrl+d进行添加") } } } function sethome(obj){ vrl = window.location; 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); } } }