• Resolved teeboy4real

    (@teeboy4real)


    Hello,

    Please can you add support to only enable floating buttons on mobile devices and disable on desktop devices.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Christine

    (@cdegraff1)

    We will add it to our list of requests.

    tapiohuuhaa

    (@tapiohuuhaa)

    That might be a big challenge. What mobile devices it is reasonable to take account? One solution is to put an additional field, which would work like Widget Logic. Users could then set conditions.

    One solution is to a new field to widget definition. There could be an option to float or not.

    Then it would be possible to use Widget logic and put two widgets, which another work with desktop computers and another with mobile devices. I have used this function:

    function tap_is_mobile(){
    global $_SERVER;
    $Firefox=strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox');
    $Tablet=strpos($_SERVER['HTTP_USER_AGENT'], 'Tablet');
    $Android=strpos($_SERVER['HTTP_USER_AGENT'], 'Android');
    $Chrome=strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome');
    $iPad=strpos($_SERVER['HTTP_USER_AGENT'], 'iPad');
    $iPhone=strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone');
    $mobile=($Chrome && $Android) || ($Firefox &&($Android || $Tablet)) || $iPad || $iPhone;
    return $mobile;
    }

    It doesn’t cover all browser, but however quite near all. In addition of Chrome, Safari for iOS, Firefox, it works with Opera mobile. I assume that it covers about 99% of mobile devices.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Enable floating only on mobile devices’ is closed to new replies.