小编Zip*_*tic的帖子

关闭Bootstrap模式onclick

我正在使用Bootstrap模式供用户在将项目添加到购物车之前选择产品选项.我之前在这个场景中使用过它们没有任何问题,但是这个没有按预期关闭.

当用户点击"添加到购物车"按钮时,会发生一些事情,我认为存在问题.首先,某些脚本会检查某些字段是否已正确完成.一旦完成验证,用户就可以将项目添加到购物车中,此时会弹出另一个窗口,让他们查看购物车内容并选择继续购物车或继续停靠.

在脚本验证完所有字段后,我希望在点击"添加到购物车"按钮后关闭模态窗口.目前,它只是坐在那里,如果用户选择继续他们离开的地方而另一个窗口关闭,它仍然存在.

模态的HTML:

   <a type="button" class="btn btn-small btn-primary" href="#product-options" data-toggle="modal"><i class="icon-shopping-cart icon-white"></i>&nbsp;Buy This!</a>                                        
       <div class="modal hide fade" id="product-options">                    
            <div class="modal-header center">
                  <a class="close modal-close l-m" data-dismiss="modal" aria-hidden="true">x</a>
                  <h2 class="modal-header">When, Where and How?</h2>
             </div>   
             <div class="modal-body ll-m r-m">
                 <h5 class="top-m">Please Choose From Delivery Options:</h5>                                                                                  
                     <label for="Standard">
                         <input id="Standard" type="radio" name="properties[Delivery]" value="Standard Shipping" />
                         <h5>Standard Shipping</h5><br />
                             <p><small>Earliest Date of Delivery: 
                                 <span id="delivery-date"></span></small></p>
                     </label>
                     <label for="datepicker" style="margin-left: 18px;">Desired Delivery Date: </label>
                          <input id="datepicker" type="text" placeholder="ex. 01/01/2013" name="properties[Delivery Date]" style="margin-left: 18px;" readonly/> …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery modal-dialog twitter-bootstrap

11
推荐指数
2
解决办法
10万
查看次数