(function($) { var tipsroot; $('script[src*=tips]').each(function(){ var s=this.src; if(s.match(/tips[^\/]*\.js/i)){tipsroot=s.replace(/[\?#].*$/, '').replace(/(^|[\/\\])[^\/]*$/, '$1');return false;} }); var tipcss=tipsroot+"css/jquery.tip.css" $('head').append(''); /*begin*/ if(window.tips)return false; $.fn.tips=function(options) { var settings=options; var $body; var $select; var messageidnumber=0; var messageid="message_tips";; if(settings.content==null){settings.content="";} if($body==null){$body=$("body");} if(!window.xmlhttprequest&&$select==null){$select=$("select");} if($select!=null){$select.css("visibility","hidden");} if(settings.type==null){settings.type="warn";} if(settings.time==null){settings.time=3000;} $.fn.tips.close(); var messagehtml=""; messagehtml+='
'; messagehtml+=' '; if(settings.type=="loading"){messagehtml+='';} messagehtml+=' '; messagehtml+=' '+settings.content+''; messagehtml+=' '; messagehtml+=' '; messagehtml+='
'; $body.append(messagehtml); var $message=$("#"+messageid); $message.slidedown(300); if(settings.type!="loading") { settimeout(function(){ $message.animate({width:0,height:0},"toggle",function(){ $message.remove(); if ($select!=null){ $select.css("visibility","visible"); } }); },settings.time); } } $.fn.tips.close=function(){ $("#message_tips").remove(); } /*over*/ })(jquery);