Jquery UI dialog not working along side JQuery Mobile

大城市里の小女人 提交于 2019-11-29 18:04:56

After reading the post Using multiple versions of jquery ui from RedNao i was able to create a simple proof of concept.

The idea is to swap two instances of jQuery but, you are warned, i haven't fully tested against heavy usage in code.

After that, i'm hiding the UI dialog markup to jQuery Mobile by using data-enhance="false".

<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
   var jQM=jQuery, $QM=$;
</script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
  var jQUI=jQuery, $QUI=$;
  window.jQuery = jQM;
  window.$ = $QM;
  $(document).on('mobileinit', function () {
    $.mobile.ignoreContentEnabled = true;
  });

</script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Then, it looks like this:

Plunker: https://plnkr.co/edit/oOg6cKEuMFXVrMn3ntCb?p=preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!