繁体   English   中英

单击此单选按钮的自定义iCheck设计可防止在单击时输出总价

[英]The custom iCheck design of the radio button prevents the output of Total price when clicked

我试图理解为什么当我单击单选按钮时,看不到总价的输出,但是当我在jsfiddle或单独的test.php页面中运行我的代码时却没有引用脚本对于iCheck,显示的是总价格。 iCheck的设计如何受到干扰? 我该如何解决此问题?

icheck.js

 $(document).ready(function(){
  $('input').iCheck({
   checkboxClass: 'icheckbox_square-blue',
   radioClass: 'iradio_square-blue',
  increaseArea: '20%' // optional
 });
});

price.js //单击单选按钮时输出总价

  $(document).ready(function(){
  //alert();
     $(document).on("click", ".btn-checkbox-plan", function(e){
       if($(".btn-checkbox-plan").is(':checked')){

        $("#output").html($(this).val());
       }

     });  

    });

码:

<div class="checkout">
                    <span id="checkout-title">Checkout</span>
                    <div class="plan-wrapper">
                        <input class="btn-checkbox-plan" type="radio" name="groupnine" value="$699" /> <label id="silver-plan">Silver Plan</label>
                        <label id="silver-plan-price">$699</label>
                        <input class="btn-checkbox-plan" type="radio" name="groupnine" value="$999" /> <label id="gold-plan"> Gold Plan</label>
                        <label id="gold-plan-price">$999</label>
                    </div>
                    <div class="logo-wrapper">
                        <span id="personalized-logo">Personalized Logo</span>
                        <span id="logo-price">$49.99</span>
                    </div>
                    <div class="tax-wrapper">
                        <div class="wrapper-a">
                            <span id="tax">Tax + Processing</span>
                            <span id="tax-price">$0.00</span>
                       </div>
                    </div>
                    <div class="total-wrapper">
                        <div class="wrapper-b">
                            <span id="total">Total</span>
                            <output type="number" name="price" id="output"></output>
                        </div>
                    </div>
                    <div class="controls submit-btn">
                        <input  type="submit" value="Checkout" />
                        <input  type="reset" value="Clear" />
                    </div>
                    <div class="controls back-btn">
                        <input  class="back-button" type="button" value="Back" />
                    </div>
                </div>

您需要使用回调http://fronteed.com/iCheck/

$('input').on('ifChecked', function(event){
  alert(event.type + ' callback');
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM