jQuery UI Touch Punch在Chrome和Opera上无法在Android设备上运行 [英] jQuery UI Touch Punch is not working in chrome and opera on android device
问题描述
我在我的网站上使用jQuery UI拖放和可排序,但无法在chrome和Opera等Android设备浏览器中使用,但可以在默认浏览器和Firefox mobile中使用.即使我使用了Touch Punch插件.
Im using jQuery UI drag&drop and sortable in my website but its not working in android device browsers like chrome and opera but its working in default browser and Firefox mobile. Even I used Touch Punch plugin.
是由于Android设备中的浏览器兼容而出现的问题吗?
Is that issue because of browser compatible in android devices?
推荐答案
我在某些移动浏览器上遇到了相同的问题,而其他浏览器运行良好.我可以通过将type ="text/javascript"添加到脚本标签中来解决问题,如下所示
I ran into the same issue with certain mobile browsers, while others worked well. I was able to fix if by adding type="text/javascript" to my script tag as follows
<script type="text/javascript"><!-- copy TouchPunch JQuery hack here --></script>
或者如果您在外部文件中包含js,请确保添加type属性
or if you have the js in an external file, be sure to add the type attribute
<script type="text/javascript" src="http://domain.com/pathtotouchpunchjsfile.js"></script>
(提示:为了在不同浏览器之间获得最大的兼容性,我使用结束脚本标签而不是自动关闭标签)
(Side tip: for maximum compatibility among different browsers I use an ending script tag instead of just self-closing it)
这篇关于jQuery UI Touch Punch在Chrome和Opera上无法在Android设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!