单击标题中的链接时如何显示弹出窗口?

时间:2015-08-04 06:26:15

标签: php html codeigniter popup

在我的标题中提供了添加新客户端的链接。单击添加客户端链接时,会显示一个包含文本框和提交按钮的弹出窗口。当我单击链接显示弹出窗口时,完全淡入(阴影)并且不显示标签

这里有什么问题?

标题

 <a data-hover="dropdown" data-close-others="true" data-toggle="modal" class="dropdown-toggle" href="#addClientPop" <?php if($home_index== 1) { ?> class="active" <?php } ?>></span>
  Add Client<span class="arrow"></span>
                            </a> 

<div id="addClientPop" class="modal hide fade" tabindex="-1" data-width="760">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                <h3>Add Client</h3>
                                            </div>
                                            <div class="modal-body">
                                                <div class="scroller" style="height:75px" data-always-visible="1" data-rail-visible1="1">
                                                    <div class="row-fluid">
                                                        <div class="control-group">
                                                            <label class="control-label">Client Name</label>
                                                            <div class="controls">
                                                                <input id="client_name" name="client_name" class="client_box" type="text" class="form-control" required >                                                                                                    
                                                            </div>
                                                        </div>   
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="modal-footer">     
                                                <button onClick="submit_client();" type="button" class="btn blue">Submit</button>
                                            </div>
                                        </div>

3 个答案:

答案 0 :(得分:1)

                 <li>
                  <a data-hover="dropdown" data-close-others="true" data-toggle="modal" class="dropdown-toggle active" href="#addPop" >
Add Client<span class="arrow"></span>
                  </a>

           <div id="addPop" class="modal fade" tabindex="-1" aria-hidden="true">
 <div class="modal-dialog ">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
            <h3>Add Client</h3>
        </div>
        <div class="modal-body">
            <div class="scroller" style="height:75px" data-always-visible="1" data-rail-visible1="1">
                <div class="row-fluid">
                    <div class="control-group">
                        <label class="control-label">Client Name</label>
                        <div class="controls">
                            <input id="market_price" name="market_price" class="client_box" type="text" class="form-control" required >

                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="modal-footer">

            <button onClick="submit_price();" type="button" class="btn blue">Submit</button>
        </div>
      </div>
     </div>
  </div>
 </li>                                                                            

答案 1 :(得分:0)

在您的代码中,我注意到您已关闭</span>中的<a>标记,如果($ home_index == 1),则class属性将被添加两次。

应该是这样的:

<a data-hover="dropdown" data-close-others="true" data-toggle="modal" class="dropdown-toggle <?php if($home_index== 1) { echo 'active';}?>" href="#addClientPop">Add Client <span class="fa fa-arrow-down"></span> </a>

答案 2 :(得分:0)

这是我运作良好的解决方案enter image description here

<a data-hover="dropdown" data-close-others="true" data-toggle="modal" class="dropdown-toggle active" href="#addClientPop" > Add Client<span class="arrow"></span> </a>

<div id="addClientPop" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog "> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h3>Add Client</h3> </div> <div class="modal-body"> <div class="scroller" style="height:75px" data-always-visible="1" data-rail-visible1="1"> <div class="row-fluid"> <div class="control-group"> <label class="control-label">Client Name</label> <div class="controls"> <input id="client_name" name="client_name" class="client_box" type="text" class="form-control" required >
</div> </div>
</div> </div> </div> <div class="modal-footer">
<button onClick="submit_client();" type="button" class="btn blue">Submit</button> </div> </div> </div> </div>