123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- function isMobile(){
- return navigator.userAgent.match(/iPhone|iPad|iPod|Android|android|BlackBerry|IEMobile/i) ? true : false;
- }
- function is_showdoc_online(){
- var host = window.location.host;
- if(host.indexOf("showdoc.cc") > -1 || host.indexOf("wu.com") > -1){
- return true;
- }else{
- return false;
- }
- }
- function set_text_color( id , color){
- var cookie_key = "is_"+id+"_click";
- var is_click = getCookie(cookie_key);
- if (!is_click) {
- $("#"+id).css("color",color);
- };
- $("#"+id).click(function(){
- var is_click = getCookie(cookie_key);
- if (!is_click) {
- $(this).css("color","");
- setCookie(cookie_key , 1 , 900);
- };
- });
- }
- function setCookie(NameOfCookie, value, expiredays)
- {
-
-
-
-
- var ExpireDate = new Date ();
- ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
-
-
- document.cookie = NameOfCookie + "=" + escape(value) +
- ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
- }
- function getCookie(NameOfCookie)
- {
-
-
- if (document.cookie.length > 0)
- {
-
-
-
-
- begin = document.cookie.indexOf(NameOfCookie+"=");
- if (begin != -1)
- {
-
- begin += NameOfCookie.length+1;
- end = document.cookie.indexOf(";", begin);
- if (end == -1) end = document.cookie.length;
- return unescape(document.cookie.substring(begin, end)); }
- }
- return null;
-
- }
- function delCookie (NameOfCookie)
- {
-
-
- if (getCookie(NameOfCookie)) {
- document.cookie = NameOfCookie + "=" +
- "; expires=Thu, 01-Jan-70 00:00:01 GMT";
- }
- }
- function show_top_msg(msg,delay){
- $.bootstrapGrowl(msg, {
- ele: 'body',
- type: 'info',
- offset: {from: 'top', amount: 20},
- align: 'center',
- width: 'auto',
- delay: delay,
- allow_dismiss: true,
- stackup_spacing: 10
- });
- }
- function closeDiv(target) {
- $(target).hide();
- }
|