跟踪点击事件

时间:2016-05-12 17:47:21

标签: javascript

三个不同的饼图将以不同的值显示。 (介于$ 1 - $ 1000,$ 1000 - $ 5000及$ 5000以上)

当我在一个饼图上点击风险等级时,如何在切换到不同的饼图时保持该风险等级。

原始风险级别

original risk level

当我滑入新馅饼时如何保持风险等级?

how do I keep the risk level when I slide to a new pie?

    $(".slide").on("change", function() {
  var a = (this.value);


  if (a < 999) {

    $('#three, #two, #risk-label-full, #risk-label-four').hide();
    $('#one, #tolerancelist_two, #risk-label-two').show();


  } else if (a >= 1000 && a <= 5000) {
    $('#risk-label-full').on('click', function(evt) {
        $('#risk-label-four').show();
        return false;//Returning false prevents the event from continuing up the chain
    });
    $('#one, #three, #risk-label-two, #risk-label-full').hide();
    $('#two, #tolerancelist_four, #risk-label-four').show();
  } else if (a >= 5001) {

    $('#two, #one, #risk-label-four, #risk-label-two').hide();
    $('#three, #tolerancelist_full, #risk-label-full').show();
  }


  if (a == 10000) {
    $('#slider-plus').show();
  } else if (a <= 9999) {
    $('#slider-plus').hide();
  }

});


      $(".tolerancerisk_two").click(function(e) {
        if( $(this).hasClass("active") ) {
            $(this).removeClass("active").addClass("closed");
        } else {
            // if other menus are open remove open class and add closed
            $(this).siblings().removeClass("active").addClass("closed");
            $(this).removeClass("closed").addClass("active");
        }
  });

  $(".tolerancerisk_four").click(function(e) {

        if( $(this).hasClass("active") ) {
            $(this).removeClass("active").addClass("closed");
        } else {
            // if other menus are open remove open class and add closed
            $(this).siblings().removeClass("active").addClass("closed");
            $(this).removeClass("closed").addClass("active");
        }
  });

$(".tolerancerisk_full").click(function(e) {

      if( $(this).hasClass("active") ) {
          $(this).removeClass("active").addClass("closed");
      } else {
          // if other menus are open remove open class and add closed
          $(this).siblings().removeClass("active").addClass("closed");
          $(this).removeClass("closed").addClass("active");
      }
});

0 个答案:

没有答案