美文网首页
如果是用手机访问,刚进入到移动端

如果是用手机访问,刚进入到移动端

作者: 从此以后dapeng | 来源:发表于2016-11-24 16:31 被阅读10次

如果是用手机访问,刚进入到移动端

//如果是用手机访问,刚进入到移动端
var userAgent = navigator.userAgent.toLowerCase();
if(userAgent.toLowerCase().indexOf("micromessenger") != -1 
    || userAgent.indexOf("android") != -1 
    || userAgent.indexOf("ios") != -1 
    || userAgent.indexOf("iphone") != -1 
    || userAgent.indexOf("ipad") != -1 
    || userAgent.indexOf("windows phone") != -1){
    window.location.href = "/static/mobile/index.html";
}

stopUserSelect

function stopUserSelect() {
    document.body.onselectstart = function() {
        return false;
    }
}

showWeChatPic

function showWeChatPic() {
    $(".weChat").hover(function() {
        $(".weChatPic").show()
    }, function() {
        $(".weChatPic").hide()
    })
}

alignFix

function alignFix() {
    var mt = "-" + $("#fp-nav ul").height() / 2 + "px"
      , t = .5 * ($(window).height() + 60);
    $("#fp-nav ul").css("marginTop", mt),
    $("#fp-nav ul").css("top", t)
}```

# animations

var timer = true;
function timeout() {
timer && setTimeout(function(){
$("#block").animate({
fontSize: "10em"
}, 'fast' );
$("#block").animate({
fontSize: "5em"
}, 'fast' );
timeout()
},500)
};

// css3
@keyframes mymove {
0% {font-size:5em;}
50% {font-size: 10em;}
100% {font-size: 5em;}
}

block{

animation: mymove .5s linear infinite;

}

相关文章

网友评论

      本文标题:如果是用手机访问,刚进入到移动端

      本文链接:https://www.haomeiwen.com/subject/iqnbpttx.html