gpt4 book ai didi

css - IE7 和 CSS 显示属性

转载 作者:太空宇宙 更新时间:2023-11-04 16:27:07 25 4
gpt4 key购买 nike

这是一些 asp.net 标记:

<tr style="display:none" id="AllInRateRow">
<td id="td6">
All-In Fixed Rate <span id="allInRateHelp" />
</td>
<td id="td7">
<%= Html.TextBoxFor(m => m.FixedRate, new { @class = "economicTextBox", propertyName = "FixedRate", dontRegisterNewIndication = true })%> %
</td>
</tr>

<tr style="display:none" id="ProfitRow">
<td id="td93">
Your Swap Profit
</td>
<td id="yourSwapProfit">
<%= Html.TextBoxFor(m => m.Fees.ProfitAmount, new { @class = "economicTextBox", propertyName = "Fees.ProfitAmount", dontRegisterNewIndication = true })%>
<%= Html.RadioButtonFor(m => m.Fees.ProfitType, (int)Chatham.Enumerations.IndicationProfitType.bps,
new { label = "bps", propertyName = "Fees.ProfitType", dontRegisterNewIndication = true })%>
bps
<%= Html.RadioButtonFor(m => m.Fees.ProfitType, (int)Chatham.Enumerations.IndicationProfitType.CurrencyAmount,
new { label = "$", propertyName = "Fees.ProfitType", dontRegisterNewIndication = true })%>
$
</td>
</tr>

我认为这是 CSS 显示属性的问题。它不会在页面加载时显示它们,这是正确的,但是选择它应该会改变它:

<td id="td4">
Options <span id="solverHelper" />
</td>
<td id="solveType">
<%=Html.DropDownListFor(m => m.Fees.CalculationSource, DropDownData.SolverOptionsList(),
new { propertyName = "Fees.CalculationSource", dontRegisterNewIndication = true })%>
</td>

这些事情是通过 JQuery 设置 CSS 并像这样更改它来实现的:

    var pricingOptions = $("#Fees_CalculationSource").val();
if(pricingOptions == <%= ((int)Chatham.Web.Models.Indications.SwapModel.SolverOptions.AllInRate).ToString() %>)
{
$("#AllInRateRow").css("display", "none");
$("#ProfitRow").css("display", "table-row");
if(canExcludeFees) $("#IncludeFeesOption").css("display", "table-row");
else $("#IncludeFeesOption").css("display", "none");

}
else if (pricingOptions == <%= ((int)Chatham.Web.Models.Indications.SwapModel.SolverOptions.Profit).ToString() %>)
{
$("#AllInRateRow").css("display", "table-row");
$("#ProfitRow").css("display", "none");
$("#IncludeFeesOption").css("display", "table-row");
if(canExcludeFees) $("#IncludeFeesOption").css("display", "table-row");
else $("#IncludeFeesOption").css("display", "none");

}
else if (pricingOptions == <%= ((int)Chatham.Web.Models.Indications.SwapModel.SolverOptions.None).ToString() %>)
{
$("#AllInRateRow").css("display", "table-row");
$("#ProfitRow").css("display", "none");
$('input[propertyname=Fees.IncludeFeeIndicator]:eq(1)').attr('checked', 'checked');
$(

"#IncludeFeesOption").css("display", "none");
}

我认为 IE7 无法将 CSS 设置为 table-row 属性,但它可以使用“none”。

我说的对吗?如果是,有什么解决方法?

最佳答案

如果我没记错的话,IE7 使用 display:block。显示元素的最简单方法是从 jQuery 调用显示/隐藏方法,而不是尝试自己控制显示属性。

$("#AllInRateRow").show();
$("#ProfitRow").hide();

这适用于所有浏览器,您无需担心浏览器的具体情况。

关于css - IE7 和 CSS 显示属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5312670/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com