Javascript not triggering with href jquery mobile - data tra
Javascript not triggering with href jquery mobile - data transition with window.location
当我用
更改页面时,我发现jquery移动版有问题 <input type="button" onclick="window.location.href = 'page.html'"
value="New Page">
一切正常,但我想添加一个过渡,所以我试图改变我的代码
<a data-transition="slide" href="page.html>New Page</a>
但是在新的页面中所有的javascript工作不好,页面的布局没有以正确的方式加载,javascript代码在主文件中不会触发(所有的var,我在js中声明的结果未定义,如果我回到首页与一个href幻灯片菜单仍然被阻止在半宽度)
所以我想避免这个问题离开window.location.href,但我需要页面过渡,我怎么能管理有过渡和js正常工作?
主:<div id="home" class="upage-content">
<a href="join.html" data-transition="slide">Join</a>
</div>
加入:<body>
<div class="uwrap">
<div class="upage" id="mainpage" style="min-height:100% !important;" data-role="page">
<script type="application/javascript" src="js/jquery.min.js"></script>
<script type="application/javascript" src="jqm/jquery.mobile-min.js" data-ver="0"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBsDjPNTwvkFNGFQp-AN6A6xF5N7_3Pxx0&sensor=false"></script>
<script type="text/javascript" src="js/main3.js"></script>
<div class="upage-outer">
<div data-role="header" class="headclass" data-uib="jquery_mobile/header" data-ver="0">
<h1>JOIN</h1>
当使用页面过渡时,jQuery移动端预取页面动画,如果javascript不工作,很可能是因为你要动画的页面上的javascript没有加载。移动版jQuery只会从
页面中获取内容。 data-role="page"
div。因此,为了使页面正常工作,您必须在主页的部分中包含所有javascript资源。并使用
<a data-transition="slide" href="page.html>New Page</a>
相关文章:
- 通过在Dojo mobile ViewController.openExternalView中动态更改打开同一外部视图的
- Ember Data DS.Model's set函数不起作用
- 无法从jquery Mobile导航栏重定向到另一个页面
- Extending Ext.data.NodeInterface
- jQuery Mobile getJSON get data with var
- jQuery Mobile - filter data-filtertext AND text
- 在jQuery Mobile上禁用data-role=“header”上的页面过渡
- JQuery Mobile:使用 CSS @media 查询修改 button data-inline=“tru
- Jquery mobile data-rel=“dialog” 在 iPhone 或 iPad 上不起作用
- 如何在Jquery Mobile中创建一个指向data.prevPage的按钮
- Mobile changePage Post Data
- Jquery Mobile data-role="content"无需使用Jquery Mobile
- jQuery Mobile data-role="header"单击“事件未触发”
- jQuery/jQuery Mobile .data()附加无法在click中检索到的数据
- Javascript not triggering with href jquery mobile - data tra
- jQuery Mobile Beta版:不能再使用$('[data role=header]')
- PhoneGap Jquery Mobile Ajax 回调在 data-native-menu=“false” 时不起
- data-url属性在jquery mobile中做什么?
- 为什么data-role不能在Jquery Mobile中工作
- 如何在jQuery Mobile中动态更改页面元素的data-theme