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.