// JavaScript Document ;(function($){ $.fn.Favorite=function(options){ var defaults = { }; var o = $.extend(defaults, options||{}); return this.each(function() { $(this).attr('href','javascript:void(0);').css({"cursor":"pointer"}).bind('click',function(){ try {window.external.addFavorite('http://'+window.location.href, document.title);}catch (e) {try {window.sidebar.addPanel(document.title, 'http://'+window.location.href, "");}catch (e) {alert("加入收藏失败,请按Ctrl+D手动添加");}} }); }); } })(jQuery) //设为首页 ;(function($){ $.fn.Homepage=function(options){ var defaults = { }; var o = $.extend(defaults, options||{}); return this.each(function() { $(this).attr('href','javascript:void(0);').css({"cursor":"pointer"}).bind('click',function(){ if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.setHomePage('http://'+window.location.href); } else if (window.sidebar) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true"); } } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', 'http://'+window.location.href); } }); }); } })(jQuery); ;(function($){ $.fn.adFlash2 = function(options) { var o = $.extend({ width:null,//Define Flash Width height:null, //Define Flash Height filepath:"js/ad_flash.swf", //flash广告文件位置 不修改路径无需要修改 chrcolor:"0xffffff", //文字颜色 chrlocation:2, //文字位置 chrbgcolor:'0x000000',//文字背景颜色 chrbgtransparent:50,//文字背景透明度 btnchrcolor:'0xffffff',//当前按键文字颜色 btndefaultcolor:'0xff9900',//当前按键默认颜色 btncolor:'0x000033',//按键当前颜色 time:5,//自动播放时间 单位秒 effect:2,//图片过渡效果 (0-3) isshowbtn:1,//是否显示按钮 0|1 winopen:'_blank',//打开方式 _blank,_self isshowtitle:false, //打开广告标题显示 默认关闭 selector:'', //默认图片选择器为空 li>a>img selector:'li>' ad_null:'' },options||{}); return this.each(function() { //判断高度值(如果未传递值则自动获取容器宽度和高度 if (o.width==null || isNaN(parseInt(o.width))) {o.width=$(this).width();} if (o.height==null || isNaN(parseInt(o.height))) {o.height=$(this).height();} //获取文件及链接 var config=o.chrcolor+'|'+o.chrlocation+'|'+o.chrbgcolor+'|'+o.chrbgtransparent+'|'+o.btnchrcolor+'|'+o.btndefaultcolor+'|'+o.btncolor+'|'+o.time+'|'+o.effect+'|'+o.isshowbtn +'|'+o.winopen; var files = new Array(); var links = new Array(); var texts = new Array(); var html = ""; var id_=$(this).find(o.selector+'a>img'); if (id_.length>0){ for (i=0;i'; html=html+''; html=html+''; html=html+''; html=html+''; html=html+''; }else{ html=o.ad_null; } //alert(html); //替换容器内容 $(this).html('
'+html+'
'); }); }; })(jQuery);