Simple way to identify iOS user agent in a jQuery if/then statement?

前端 未结 6 2040
心在旅途
心在旅途 2021-02-01 03:16

Exactly like it sounds..

Is there some magical and easy way to say:

    if (user agent is iOS) {
        if (browserRatio >=1.5) {
            $contai         


        
6条回答
  •  难免孤独
    2021-02-01 03:55

    Found it.

    if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
        if (browserRatio >=1.5) {
            $container.css('min-height', '360px');
        } else {
            $container.css('min-height', '555px');
        }
    }
    

提交回复
热议问题