How to stop code execution on mobile?

1 replies
Does anybody know how to stop code execution on mobile phones or tablets?

This is our website www.genuinepropertybuyers.co.uk and you will notice spokesperson in the right bottom corner. I can hide that on mobile by using CSS, but is there any way to stop or to avoid execution of that part of code (let's say the whole div) on mobile?

The reason I want to do this is that it is slowing down our website while executing although it's hidden.
#code #execution #mobile #stop
  • Profile picture of the author geekSoftware
    I will do it from jQuery by detecting the screen of the user device. For example:

    HTML Code:
    <script type="text/javascript">
         $(document).ready(function() {
              if (screen.width < 854) //use any width you would like to
                   $("#sakrij").remove();  //"sakrij"(Bosnian/Serbian word :D) is ID of spokerperson on your website
         });
    </script>
    {{ DiscussionBoard.errors[9797544].message }}

Trending Topics