控制div層的顯示以及隱藏


控制div層的顯示以及隱藏,例如,點擊登錄,彈出登錄的層。

1、添加script代碼

<script>
        function add_address(){
            $('#popup2').show();
            $('#gray').show();
        }
        function closeAddressDiv(){
            $('#popup2').hide();
        }
    </script>

2、在body標簽里面添加如下的div

<div class="popup2" id="popup2">
    <div class="top_nav" id='top_nav2'>
        <div align="center">
            <span>新增收貨地址</span>
            <a class="guanbi" href="javascript:void(0);" onclick="closeAddressDiv()"></a>
        </div>
    </div>

    <table cellpadding="0" cellspacing="0" class="my_address2">
        <tr>
            <th><span class="red">*</span>所在地區:</th>
            <td><input type="text" class="text_input" placeholder="請選擇省市區">
            </td>
        </tr>
        <tr>
            <th><span class="red">*</span>詳細地址:</th>
            <td><input type="text" class="text_input long" placeholder="建議您如實填寫詳細地址,例如街道名稱、門牌號碼、樓層和房間號等信息">  </td>
        </tr>
        <tr>
            <th><span class="red">*</span>郵政編碼:</th>
            <td><input type="text" class="text_input" placeholder="如您不清楚郵遞編號,請填寫000000">    </td>
        </tr>
        <tr>
            <th><span class="red">*</span>收貨人姓名:</th>
            <td><input type="text" class="text_input" placeholder="長度不超過25個字符">     </td>
        </tr>
        <tr>
            <th><span class="red">*</span>手機號碼:</th>
            <td>
                <select name="select" id="select" class="select_form">
                    <option >中國大陸 +86</option>
                </select>
                <input type="text" class="text_input" placeholder="手機號碼、電話號碼必須填一項">
   </td> </tr> <tr> <th>電話號碼:</th> <td> <select name="select" id="select" class="select_form"> <option >中國大陸 +86</option> </select> <input type="text" class="text_input small1" placeholder="區號"> - <input type="text" class="text_input small2" placeholder="電話號碼"> - <input type="text" class="text_input small3" placeholder="分機號"> </td> </tr> <tr> <th></th> <td><input type="checkbox" checked> 設為默認收貨地址</td> </tr> <tr> <th></th> <td><input type="submit" class="but_input" value="保 存"></td> </tr> </table> </div>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM