如何:jquery -> jquery 移动
How: jquery -> jquery mobile
我有一个使用 jquery 构建的网站,该网站尚未为移动设备做好准备。首先没有触摸,其次,我认为使用 jquery 尺寸并不完全符合我的预期。东西不太适合它所属的地方。我假设我需要去 jquery-mobile,但是如何去。
我是在之前还是之后添加 jquery-mobile 脚本?我要替换 jquery 吗?我可以保留当前的 html 还是需要添加 class 标签。我不想扔掉任何东西。我只想更改我获取维度值的行以使用 jquery-mobile,并添加触摸,然后...
这是我的 headers。
有人可以说我应该如何更改它们以合并 jquery-mobile 吗?谢谢
<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>
您不应该每次都包含所有文件。
您应该做的是检测用户使用的设备(计算机或移动设备)并加载适当的文件。
查看 this answer 了解更多信息。
请注意,Jquery Mobile 的 linkink 脚本的正确方法是:
- jquery-mobile.css
- jquery.js
- jquery-mobile.js
我有一个使用 jquery 构建的网站,该网站尚未为移动设备做好准备。首先没有触摸,其次,我认为使用 jquery 尺寸并不完全符合我的预期。东西不太适合它所属的地方。我假设我需要去 jquery-mobile,但是如何去。
我是在之前还是之后添加 jquery-mobile 脚本?我要替换 jquery 吗?我可以保留当前的 html 还是需要添加 class 标签。我不想扔掉任何东西。我只想更改我获取维度值的行以使用 jquery-mobile,并添加触摸,然后...
这是我的 headers。 有人可以说我应该如何更改它们以合并 jquery-mobile 吗?谢谢
<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>
您不应该每次都包含所有文件。
您应该做的是检测用户使用的设备(计算机或移动设备)并加载适当的文件。
查看 this answer 了解更多信息。
请注意,Jquery Mobile 的 linkink 脚本的正确方法是:
- jquery-mobile.css
- jquery.js
- jquery-mobile.js