从jQuery Mobile中的按钮删除圆角 [英] Removing round corners from the button in jquery mobile
问题描述
我在单/多页jquerymobile页面模板中有以下按钮标记.
I have following button markup in a single/multiple page jquerymobile page template.
<a href="#" data-role="button" data-icon="arrow-r" data-iconpos="right" >About Us</a>
我需要使用jquerymobile文档中提供的button选项禁用此按钮的圆角.
I need to disable the round corners of this button using the button option as given in the jquerymobile docs.
我在所有事件中都尝试过$('a').buttonMarkup({ corners: "false" })
,例如pagebeforecreate,pageinit,pagecreate和mobileinit
I have tried $('a').buttonMarkup({ corners: "false" })
in every events such as pagebeforecreate, pageinit, pagecreate and mobileinit
我从来没有使它工作过,并且一直在努力使它很长一段时间.我现在不想使用数据属性data-corners ="false".
I never got it working and have been struggling with it to make it for quite a long time. I dont want to use data attribute data-corners="false" for now.
请提出任何想法
推荐答案
这应该起作用:$('a').buttonMarkup({ corners: false })
注意"false"不应为字符串.
This should work: $('a').buttonMarkup({ corners: false })
note "false" should not be a string.
无论如何,如果您想将其作为默认行为,则可以尝试以下方法:
Anyway, if you want to make that the default behaviour, you could try something like:
$(document).bind('mobileinit', function(){
$.fn.buttonMarkup.defaults.corners=false;
});
应该与每个按钮上都有data-corners="false"
的作用相同.
that should work the same as having data-corners="false"
on every button.
这篇关于从jQuery Mobile中的按钮删除圆角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!