0

I want to create a floating button in the bottom-left corner of my page when seen in mobile devices. It's supposed to keep a fixed size (from the end user's perspective) and a fixed position even after scrolling or zooming the page.

I made several tries on the fixed size stuff with no success.

Anyone knows if it's possible (maybe with jQuery or anything else)?

Below is the code I tried last. The fixed position is already done and setup in a CSS file.

Sorry for my English but you may have noticed it's not my native language.

<script>
    function isMobile(){
        var userAgent = navigator.userAgent.toLowerCase();
        return userAgent.search(/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i)!= -1 ;
    }

    $(document).ready(function(){
        if(isMobile()){
            $('.back2mob').css('display', 'block');
        }
    });
</script>
<div class="back2mob" style="min-zoom:1; max-zoom:1;">
       <p><a href="${widgetContent.fields.url}">versão mobile</a></p>
</div>
Omar
  • 32,302
  • 9
  • 69
  • 112
Sidney de Moraes
  • 993
  • 3
  • 11
  • 29

0 Answers0