gpt4 book ai didi

javascript - 每当显示 : none; 时删除填充

转载 作者:行者123 更新时间:2023-11-28 02:58:47 43 4
gpt4 key购买 nike

图1

enter image description here

图2

enter image description here

<form class="row" method="post">
<input type="hidden" name="csrfmiddlewaretoken" value="kAM5G4Fg3VtTOHfSrzlB2ScLrkgHhBycDvA3FQcAebnlPjvoBcIX9Txyz4NQpFaJ">
<div class="card-content">
<div class="row">
<div class="col s3">
<div id="div_id_type_choice" class="input-field ">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-16fc2fd1-3a01-3d50-5f53-bf229cc2b819" value="Total number of clients">
<ul id="select-options-16fc2fd1-3a01-3d50-5f53-bf229cc2b819" class="dropdown-content select-dropdown" style="width: 158px; position: absolute; top: 1px; left: 0px; opacity: 1; display: none;">
<li class=""><span>Total number of clients</span></li>
<li class="active selected"><span>Total new loans</span></li>
<li class=""><span>Total renewals</span></li>
<li class=""><span>Total debit fees</span></li>
<li class=""><span>Total brokerage fees</span></li>
<li class=""><span>Total interest</span></li>
<li class=""><span>Total accounts receivable</span></li>
<li class=""><span>Total active accounts receivable</span></li>
<li class=""><span>Total special accounts receivable</span></li>
<li class=""><span>Total accounts loss</span></li>
<li class=""><span>Total completed loans</span></li>
<li class=""><span>Total terminated loans</span></li>
<li class=""><span>Total suspended loans</span></li>
<li class=""><span>Total delayed fees</span></li>
<li class=""><span>Total denied fees</span></li>
</ul>
<select class="select initialized" id="id_type_choice" name="type_choice">
<option value="0" selected="selected">Total number of clients</option>
<option value="1">Total new loans</option>
<option value="2">Total renewals</option>
<option value="3">Total debit fees</option>
<option value="4">Total brokerage fees</option>
<option value="5">Total interest</option>
<option value="6">Total accounts receivable</option>
<option value="7">Total active accounts receivable</option>
<option value="8">Total special accounts receivable</option>
<option value="9">Total accounts loss</option>
<option value="10">Total completed loans</option>
<option value="11">Total terminated loans</option>
<option value="12">Total suspended loans</option>
<option value="13">Total delayed fees</option>
<option value="14">Total denied fees</option>
</select>
</div>
<label for="id_type_choice">
Type
</label>
</div>
</div>
</div>
<div class="row test">
<div class="col s2">
<div id="div_id_period" class="input-field " style="display: none;">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-af71a392-11d1-9b85-c8e6-fd7ba7833d8d" value="Per week">
<ul id="select-options-af71a392-11d1-9b85-c8e6-fd7ba7833d8d" class="dropdown-content select-dropdown ">
<li class=""><span>Per day</span></li>
<li class=""><span>Per week</span></li>
<li class=""><span>Per month</span></li>
<li class=""><span>Per year</span></li>
</ul>
<select class="select initialized" id="id_period" name="period">
<option value="day">Per day</option>
<option value="week" selected="selected">Per week</option>
<option value="month">Per month</option>
<option value="year">Per year</option>
</select>
</div>
<label for="id_period">
Period
</label>
</div>
</div>
<div class="col s2">
<div id="div_id_product_type" class="input-field " style="display: block;">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-05598cb4-a85e-7a34-3437-514c079cb9d3" value="Regular">
<ul id="select-options-05598cb4-a85e-7a34-3437-514c079cb9d3" class="dropdown-content select-dropdown ">
<li class=""><span>Regular</span></li>
<li class=""><span>Special</span></li>
</ul>
<select class="select initialized" id="id_product_type" name="product_type">
<option value="regular" selected="selected">Regular</option>
<option value="special">Special</option>
</select>
</div>
<label for="id_product_type">
Product type
</label>
</div>
</div>
<div class="col s4">
<div id="div_id_from_regular_product" class="input-field ">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-733e336a-3c29-484f-eb4e-8f0a9d21690d" value="[P-01] : Loan: 300.00 $ / Brokerage Fees : 140.00 $">
<ul id="select-options-733e336a-3c29-484f-eb4e-8f0a9d21690d" class="dropdown-content select-dropdown ">
<li class=""><span>---------</span></li>
<li class=""><span>[P-01] : Loan: 300.00 $ / Brokerage Fees : 140.00 $</span></li>
<li class=""><span>[P-02] : Loan: 400.00 $ / Brokerage Fees : 185.00 $</span></li>
<li class=""><span>[P-03] : Loan: 500.00 $ / Brokerage Fees : 225.00 $</span></li>
<li class=""><span>[P-04] : Loan: 600.00 $ / Brokerage Fees : 265.00 $</span></li>
<li class=""><span>[P-05] : Loan: 700.00 $ / Brokerage Fees : 300.00 $</span></li>
<li class=""><span>[P-06] : Loan: 800.00 $ / Brokerage Fees : 335.00 $</span></li>
<li class=""><span>[P-07] : Loan: 900.00 $ / Brokerage Fees : 370.00 $</span></li>
<li class=""><span>[P-08] : Loan: 1000.00 $ / Brokerage Fees : 400.00 $</span></li>
</ul>
<select class="select initialized" id="id_from_regular_product" name="from_regular_product">
<option value="">---------</option>
<option value="1" selected="selected">[P-01] : Loan: 300.00 $ / Brokerage Fees : 140.00 $</option>
<option value="2">[P-02] : Loan: 400.00 $ / Brokerage Fees : 185.00 $</option>
<option value="3">[P-03] : Loan: 500.00 $ / Brokerage Fees : 225.00 $</option>
<option value="4">[P-04] : Loan: 600.00 $ / Brokerage Fees : 265.00 $</option>
<option value="5">[P-05] : Loan: 700.00 $ / Brokerage Fees : 300.00 $</option>
<option value="6">[P-06] : Loan: 800.00 $ / Brokerage Fees : 335.00 $</option>
<option value="7">[P-07] : Loan: 900.00 $ / Brokerage Fees : 370.00 $</option>
<option value="8">[P-08] : Loan: 1000.00 $ / Brokerage Fees : 400.00 $</option>
</select>
</div>
<label for="id_from_regular_product">
Product
</label>
</div>
<div id="div_id_from_special_product" class="input-field " style="display: none;">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-46a25f05-4238-9a9f-9538-e0eb419d09a2" value="---------">
<ul id="select-options-46a25f05-4238-9a9f-9538-e0eb419d09a2" class="dropdown-content select-dropdown ">
<li class=""><span>---------</span></li>
<li class=""><span>[S-01] : Loan: 500.00 $ / Brokerage Fees : 170.00 $</span></li>
<li class=""><span>[S-02] : Loan: 600.00 $ / Brokerage Fees : 200.00 $</span></li>
<li class=""><span>[S-03] : Loan: 700.00 $ / Brokerage Fees : 225.00 $</span></li>
<li class=""><span>[S-04] : Loan: 800.00 $ / Brokerage Fees : 250.00 $</span></li>
<li class=""><span>[S-05] : Loan: 900.00 $ / Brokerage Fees : 280.00 $</span></li>
<li class=""><span>[S-06] : Loan: 1000.00 $ / Brokerage Fees : 300.00 $</span></li>
</ul>
<select class="select initialized" id="id_from_special_product" name="from_special_product">
<option value="">---------</option>
<option value="9">[S-01] : Loan: 500.00 $ / Brokerage Fees : 170.00 $</option>
<option value="10">[S-02] : Loan: 600.00 $ / Brokerage Fees : 200.00 $</option>
<option value="11">[S-03] : Loan: 700.00 $ / Brokerage Fees : 225.00 $</option>
<option value="12">[S-04] : Loan: 800.00 $ / Brokerage Fees : 250.00 $</option>
<option value="13">[S-05] : Loan: 900.00 $ / Brokerage Fees : 280.00 $</option>
<option value="14">[S-06] : Loan: 1000.00 $ / Brokerage Fees : 300.00 $</option>
</select>
</div>
<label for="id_from_special_product">
Product
</label>
</div>
</div>
<div class="col s2">
<div id="div_id_debit_frequency" class="input-field ">
<div class="select-wrapper select initialized">
<span class="caret">▼</span><input type="text" class="select-dropdown" readonly="true" data-activates="select-options-4426e637-9e58-d48e-0b08-fd1645afbf5a" value="1 Month">
<ul id="select-options-4426e637-9e58-d48e-0b08-fd1645afbf5a" class="dropdown-content select-dropdown ">
<li class=""><span>1 Month</span></li>
<li class=""><span>2 weeks</span></li>
<li class=""><span>Bimonthly</span></li>
<li class=""><span>1 week</span></li>
</ul>
<select class="select initialized" id="id_debit_frequency" name="debit_frequency">
<option value="1month">1 Month</option>
<option value="2weeks">2 weeks</option>
<option value="bimonthly">Bimonthly</option>
<option value="1week">1 week</option>
</select>
</div>
<label for="id_debit_frequency">
Debit frequency
</label>
</div>
</div>
</div>
<div class="card-action">
<div class="right-align"><i class="btn waves-effect waves-light btn white-text waves-input-wrapper" style=""><input type="button" name="apply" value="Apply" class="waves-button-input" id="button-id-apply"></i></div>
</div>
</div>
</form>

这里的填充很烦人。即使 display: none; 允许我们让 block 消失,填充总是存在的。每当 display: none; 时,我如何删除它? flexbox 在这里可能是一个不错的选择吗?我希望下拉菜单在不为空时位于左边缘。我认为是父 div 占据了这个位置,但我不知道如何修复它。每当我从 Type 中选择一个元素时,一些底部的下拉菜单会出现而其他的会消失,然后我希望完全删除空白区域。一定要举个例子。

表单布局.py
StatisticalToolsLayout = \
CardContent(
Row(
Column('type_choice', css_class="s3"),
),
Row(
Column('period', css_class="s2"),
Column('product_type', css_class="s2"),
Column(
'from_regular_product',
'from_special_product',
css_class="col s4"),
Column('debit_frequency', css_class="s2"),
),
CardAction(
Div(
Button('apply', _('Apply'), css_class='waves-effect waves-light btn white-text'),
css_class="right-align"),
),
)

index.html

{% block content %}
<div class="row main-content">
<div class="col s10">
<div class="card">
<h5>{{ form.form_title }}</h5>
{% crispy form form.helper %}
</div>
</div>
</div>
{% endcomment %}

最佳答案

尝试将 display:none 属性赋予其父 div

关于javascript - 每当显示 : none; 时删除填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46305549/

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