大佬教程收集整理的这篇文章主要介绍了JQuery Mobile触发器(‘create’)命令不起作用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<div id="custom-header" data-role="header" data-position="inline" data-theme="f"> <a href="index.html" data-icon="BACk" style="margin-top:5px" data-theme="b">BACk</a> <div style="text-align: center; padding-top: 5px; padding-bottom: 3px"><img src="../images/logo.png" ></div> <a href="index.html" data-icon="home" style="margin-top:5px" data-theme="b">Home</a> </div>
在我的主要文件中,我基本上是这样做的:
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script> <div data-role="page" id="test-console" data-theme="m"> <div id="me-header"></div> <script> $.get('header.html',function (retData) { $('me-header').html(retData).trigger('create'); }); </script> </div>
所以这里的问题 – 标题没有渲染与将粘贴到我的JQM页面中的header.html的内容一样。几乎感觉像触发器(“创建”)没有做任何事情。
有任何想法吗?我烧了大约三个小时,像http://jquerymobiledictionary.pl/faq.html这样的教程似乎不适用..
$('#me-header').closest(":jqmData(role='page')").trigger('pagecreate');
这是一个jQM bug:https://github.com/jquery/jquery-mobile/issues/2703。
根据问题报告中的@L_674_15@,多次呼叫pagecreate可能会导致问题,如https://github.com/jquery/jquery-mobile/issues/2703#issuecomment-4677293所述。
以上是大佬教程为你收集整理的JQuery Mobile触发器(‘create’)命令不起作用全部内容,希望文章能够帮你解决JQuery Mobile触发器(‘create’)命令不起作用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。