jQuery Mobile-data-role ="none"有时不工作 [英] Jquery mobile - data-role="none" not working sometimes

查看:99
本文介绍了jQuery Mobile-data-role ="none"有时不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序上有一个非常奇怪的行为.我有一个页面div的导航.在第一页上,我激活了Rateit插件.如果我在网址中使用#one重新加载第一页,则将忽略data-role ="none".这整天让我发疯,我尝试设置jsfiddle,但是由于我还需要rateit插件,所以我做不到.

I have a really strange behavior on my app. I have a navigation for the page divs. On the first page I have the rateit plugin active. If I reload the first page with the #one in url, the data-role="none" is ignored. this has been driving me nuts the whole day, I tried to setup an jsfiddle but since I need the rateit plugin also, I couldn't.

我的应用具有链接按钮和取消按钮的简单导航,这会触发ResetAll()javascript函数.

My app have a simple navigation with link buttons and a cancel button, which fires a ResetAll() javascript function.

这是代码:

页面标题

<script src="assets/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
    $(document).bind("mobileinit", function(){
        $.extend( $.mobile , {
            ignoreContentEnabled : true
        });
    });
</script>   
<script src="assets/jquery.mobile-1.3.2.min.js"></script>

div <div data-role="page" id="one">

    <div class="rateit bigstars" id="rateitcontainer" data-rateit-step="1" 
data-rateit-starwidth="128" data-rateit-starheight="128" 
data-rateit-resetable="false" data-role="none"></div>

取消按钮

<p><a href="#cancel" class="button floated smallbutton" data-role="button" data-theme="e" onclick="ResetAll()">cancel</a></p>

还有全部重置功能

function ResetAll() {
    window.location.href = "#one";
    location.reload(true);
};

当我加载像domain.com/#one这样的页面时(重新加载后会发生什么),星空上有一个丑陋的div,我无法摆脱它!请帮助某人!

When I am loading the page like this domain.com/#one (what happens after the reload) there is this ugly div above the stars, and I can't get rid of it! Please help someone!

推荐答案

好吧,这简直太疯狂了,我确定我之前已经尝试过了,但是现在可以了.

Ok this is just nuts and crazy, I am sure I tried this already before, but now its working.

data-role="none"不起作用,因为div不是JQM小部件,因此未应用.

The data-role="none" is not working because the div is not a JQM widget, thus not applied.

div需要 data-enhance="false" 才能设置样式!
我是在jQuery论坛上学到的.不知道为什么我没有早点上班...

The div needs data-enhance="false" to be not styled!
I learned this on the jQuery forum. No idea why I did it not get to work earlier...

这篇关于jQuery Mobile-data-role ="none"有时不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆