/* *author:null *date:2013.5.24 */ $(function(){ //头页登录 $("#navul > li").not(".navhome").hover(function(){$(this).addclass("navmoon")},function(){$(this).removeclass("navmoon")}) var maxwidth = 580; $(".news_text img").each(function(){ if ($(this).width() > maxwidth) { $(this).width(maxwidth);} }); }); function $tomato(id) { return document.getelementbyid(id); } function runcode(obj) { var winname = window.open('', "_blank", ''); winname.document.open('text/html', 'replace'); winname.document.writeln(obj.value); winname.document.close(); } (function($){ $.fn.capacityfixed = function(options) { var opts = $.extend({},$.fn.capacityfixed.deflunt,options); var fixedfun = function(element) { var top = opts.top; element.css({ "top":top }); $(window).scroll(function() { var scrolls = $(this).scrolltop(); if (scrolls > top) { if (window.xmlhttprequest) { element.css({ position: "fixed", top: 0 }); } else { element.css({ top: scrolls }); } }else { element.css({ position: "absolute", top: top }); } }); element.find(".close-ico").click(function(event){ element.remove(); event.preventdefault(); }) }; return $(this).each(function() { fixedfun($(this)); }); }; $.fn.capacityfixed.deflunt={ right : 0,//相对于页面宽度的右边定位 top:95 }; })(jquery);