HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot//www.sainao.net/js/base.js
$(function(){
    if(!placeholderSupport()){
        $('[placeholder]').focus(function() {
            var input = $(this);
            if (input.val() == input.attr('placeholder')) {
                input.val('');
                input.removeClass('placeholder');
            }
        }).blur(function() {
            var input = $(this);
            if (input.val() == '' || input.val() == input.attr('placeholder')) {
                input.addClass('placeholder');
                input.val(input.attr('placeholder'));
            }
        }).blur();
    };
    if(!IsPC()){$('body').addClass('touch_body')}
    //ie浏览器
    if(isIE()){$('html').addClass('isIe');}
    // 获取当前url
    var url_location = window.location.pathname;
    var arr = [];
    arr = url_location.split('/');
})

function placeholderSupport() {
    return 'placeholder' in document.createElement('input');
}
function scrollT($Dom){
    if($Dom.offset()){
      if($(window).scrollTop()+$(window).height()>=$Dom.offset().top+200){
          return true;
      }
    }
}
function mainBgResize1($img, width, height, W_b, H_b) {
    var sw = width,
        sh = width / W_b * H_b
    if (sh < height) {
        sh = height;
        sw = height / H_b * W_b
    }
    $img.css({height:sh,width:sw, marginTop: -(sh - height) / 2, marginLeft: -(sw - width) / 2, 'visibility': 'visible' });

}
//判断是否Firefox浏览器
function isFirefox(){
    if (navigator.userAgent.indexOf("Firefox") > -1) 
    return true;
    else
    return false;
}
//判断是否IE浏览器
function isIE() {
    if (!!window.ActiveXObject || "ActiveXObject" in window)
    return true;
    else
    return false;
}
function IsPC() { 
   var userAgentInfo = navigator.userAgent; 
   var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); 
   var flag = true; 
   for (var v = 0; v < Agents.length; v++) { 
       if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } 
   } 
   return flag; 
}  
//绑定事件监听
function addEvent(eve,callback){
  if (window.attachEvent){
      window.attachEvent("on"+eve,callback); 
  }else if(window.addEventListener) { 
      window.addEventListener(eve,callback,false);   
  }
}
//判断pad横屏竖屏,刷新页面
addEvent('load', function(){
   // orientationChange();
    window.onorientationchange = orientationChange;
});
function orientationChange() {
   switch(window.orientation) {
case 0: 
		         //alert("肖像模式 0,screen-width: " + screen.width + "; screen-height:" + screen.height);
		         window.location.reload();
		         break;
case -90: 
		        //alert("左旋 -90,screen-width: " + screen.width + "; screen-height:" + screen.height);
		      window.location.reload();
		        break;
case 90:   
		       // alert("右旋 90,screen-width: " + screen.width + "; screen-height:" + screen.height);
			window.location.reload();
			break;
case 180:   
		//alert("风景模式 180,screen-width: " + screen.width + "; screen-height:" + screen.height);
		window.location.reload();
		break;
	}
 };
//获取IE浏览器版本
function getBrowserVersion(){
  var hc = $('html').attr('class');
  if(hc){
    var ieVersion = hc && hc.split(' ')[1];
    if(ieVersion){
      $('.browserupgrade>strong').text(ieVersion.toUpperCase());
    }
  }
}
getBrowserVersion();
//鼠标延迟执行事件方法
$.fn.hoverDelay = function(options){
    var defaults = {
        hoverDuring: 200,
        outDuring: 200,
        hoverEvent: function(){
            $.noop();
        },
        outEvent: function(){
            $.noop();    
        }
    };
    var sets = $.extend(defaults,options || {});
    var hoverTimer, outTimer, that = this;
    return $(this).each(function(){
        $(this).on('mouseenter',function(){
            clearTimeout(outTimer);
            hoverTimer = setTimeout(function(){sets.hoverEvent.apply(that)}, sets.hoverDuring);
        });
        $(this).on('mouseleave',function(){
            clearTimeout(hoverTimer);
            outTimer = setTimeout(function(){sets.outEvent.apply(that)}, sets.outDuring);
        });
    });
}