【发布时间】:2013-01-07 08:54:02
【问题描述】:
当使用单选按钮时,在 IE 8 中避免角落问题的正确用法是什么? 例如
我的数据表中有<p:column id="rad" selectionMode="single" />
在 IE 8 中,单选按钮呈现为复选框,即在一个方框中。所以为了解决这个问题,我使用了
<h:outputScript library="primefaces" name="jquery/jquery.js">
$(document).ready(function() {
$('rad').corner();
});
</h:outputScript>
但这并没有解决问题。
那么为单选按钮设置圆角的正确方法是什么?
谢谢
编辑 1
<h:head>
<style type="text/css">
<![CDATA[
.radio input
{
position: absolute;
left: -9999px;
}
.label_radio
{
background: url("/radio_labels.jpg") no-repeat scroll 0 0 transparent;
height: 1em;
width: 1em;
}
.label_radio.r_on
{
background-position: 0 -18px;
}
.radio label
{
display: inline;
padding-bottom: 0.1em;
padding-right: 1.9em;
}
]]>
</style>
</h:head>
<h:outputScript>
$(document).ready(function() {
alert("1");
$('.rad label').addClass('label_radio');
if ($('.rad input').length) {
$('.rad input').each(function () {
$(this).next('label').removeClass('r_on');
});
$('.rad input:checked').each(function () {
$(this).next('label').addClass('r_on');
});
};
});
</h:outputScript>
和数据表中的单选按钮。
<p:column id="rad" selectionMode="single" />
【问题讨论】:
-
图像是迄今为止在 IE 中获得圆角的最佳解决方案 :)
标签: jquery jsf-2 primefaces