欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

//下面两个函数 判断浏览器是不是原生chrome

shiping1 的头像
//下面两个函数  判断浏览器是不是原生chrome
function _mime(where, value, name, nameReg) {
        var mimeTypes = window.navigator.mimeTypes,
            i;

        for (i in mimeTypes) {
            if (mimeTypes[i][where] == value) {
                if (name !== undefined && nameReg.test(mimeTypes[i][name])) return !0;
                else if (name === undefined) return !0;
            }
        }
        return !1;
    }

function _getChromiumType() {
        

        var isOriginalChrome = _mime('type', 'application/vnd.chromium.remoting-viewer');

        // 原始 chrome
        if (isOriginalChrome) {
            return 'chrome';
        }
        return '';
    }
  

//$.browser.webkit是判断 webkit ; _getChromiumType是判断是不是原生的chrome
if($.browser.webkit && _getChromiumType()=='chrome'){
    $(window).scroll(function(){
        
        
        
            $('#looyuouter').css('position','absolute');
            $('#miaov_float_layer_zx_right').css('position','absolute');
            var tScroll = getScroll();
            t1 = tScroll+120;
            
            $('#looyuouter').css('top',t1+'px');
            
            var tHeight =  getHeight();  
            //alert(t);
            //alert(t2);    
            t2 = tScroll+tHeight-357;//滚动高度 + 页面高度 - 本身高度
            $('#miaov_float_layer_zx_right').css('top',t2+'px');
   });
普通分类: