我有一个导航栏,我已经能够像我喜欢这个jQuery代码一样修复它的行为:
$(document).bind('mobileinit', function () { $.mobile.activeBtnClass = 'unused'; });但这样我禁用了我的webapp中的所有按钮......
我想把它瞄准一组特定的按钮。
我怎样才能做到这一点?
我会做:
$(document).bind('mobileinit', function () { $(".myclass").activeBtnClass = 'unused'; });要么
$(document).bind('mobileinit', function () { $(".myclass").mobile.activeBtnClass = 'unused'; });但这不会奏效......
哪里不对?
I have a navigation bar and I've been able to fix its behaviour as I like with this jQuery code:
$(document).bind('mobileinit', function () { $.mobile.activeBtnClass = 'unused'; });But this way I disable ALL the buttons in my webapp...
I'd like to aim it to a specific set of buttons.
How can I achieve that?
I'd do:
$(document).bind('mobileinit', function () { $(".myclass").activeBtnClass = 'unused'; });or
$(document).bind('mobileinit', function () { $(".myclass").mobile.activeBtnClass = 'unused'; });But this won't work...
What is wrong?
最满意答案
你的建议很有意思,roXon,但因为我想让用户在使用我的webapp时了解他的位置。
幸运的是jQuery人员考虑过这种问题,我已经能够非常轻松地解决这个问题,添加了class =“ui-btn-active ui-state-persist”所以我的按钮。
不管怎么说,还是要谢谢你!
Your suggestion was interesting, roXon, but since I wanted to let the user understand where he was while using my webapp.
Fortunately jQuery guys thought about this kind of issue and I have been able to solve the problem very easily adding class="ui-btn-active ui-state-persist" so my button.
Thanks anyway!
更多推荐
发布评论