0

I have a web site built with jquery which is not ready for mobile devices. First no touch and second, I think using jquery the dimensions are not quite what I expect. Stuff doesn't quite fit where it belongs. I'm assuming I need to go to jquery-mobile, but how.

Do I add the jquery-mobile scripts, before or after? Do I replace jquery? Can I keep my current html or do I need to add class tags. I don't want to throw anything away. I just want to change lines where I am getting dimension values to use jquery-mobile, and add touch, and ...

Here's my headers. Can someone say how I should change them to incorporate jquery-mobile? Thanks.

<head>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
LenB
  • 1,126
  • 2
  • 14
  • 31

1 Answers1

1

You shouldn't include all the files everytime.

What you should do is detect what device the user is using (computer or mobile device) and load the appropriates files.

Check this answer for more informations.

Note that the correct way of linkink script with Jquery Mobile is :

  1. jquery-mobile.css
  2. jquery.js
  3. jquery-mobile.js
Community
  • 1
  • 1
Romain Derie
  • 516
  • 7
  • 17